Attempt to make CWorld correct instance of Store

This commit is contained in:
2022-08-20 15:53:37 +01:00
parent e1a555ea02
commit 8571ab9254
89 changed files with 570 additions and 19 deletions
+9
View File
@@ -1,6 +1,8 @@
--{-# LANGUAGE StandaloneDeriving #-}
--{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE ScopedTypeVariables #-}
{- |
WARNING: orphan instances concerning Aeson classes and Linear.Quaternion datatypes have been introduced.
The warnings have been disabled.
@@ -15,6 +17,9 @@ import Geometry.Data
import Geometry.Vector3D
import qualified Linear.Quaternion as Q
import Linear.Quaternion
import TH.Derive
import Data.Store
import LinearHelp
instance ToJSON a => ToJSON (Q.Quaternion a) where
toEncoding = genericToEncoding defaultOptions
@@ -35,3 +40,7 @@ vToQuat a b
| otherwise = Q.axisAngle cprod (angleVV3 a b)
where
cprod = crossProd a b
$($(derive [d|
instance (Store a => Deriving (Store (Quaternion a)))
|]))