Attempt to make CWorld correct instance of Store
This commit is contained in:
@@ -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)))
|
||||
|]))
|
||||
|
||||
Reference in New Issue
Block a user