Created
May 21, 2018 07:05
-
-
Save jchia/d6cfeae0df45d6a3afedd77aa6eac045 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class (Eq a, Hashable a, Show a, Typeable a) => Computable a where | |
| toCCode :: a -> CCode | |
| toCCodeMay :: a -> Maybe CCode | |
| toCCodeMay = map Just toCCode | |
| defValue :: a | |
| isDefValue :: a -> Bool | |
| isDefValue = (== defValue) | |
| instance Computable Foo where | |
| ... | |
| instance Computable Bool where | |
| ... | |
| instance Computable Double where | |
| ... | |
| instance Computable Nse where | |
| ... | |
| instance Computable Nanos where | |
| ... | |
| data Nl a where | |
| Imported :: Computable a => Int -> Nl a | |
| FooIsFull :: Nl Foo -> Nl Bool | |
| FooTime :: Nl Foo -> Nl Nse | |
| FooVal :: Nl Foo -> Nl Double | |
| TimeMinus :: Nl Nse -> Nl Nse -> Nl Nanos | |
| DurationMinus :: Nl Nanos -> Nl Nanos -> Nl Nanos | |
| Minus :: Nl Double -> Nl Double -> Nl Double | |
| AMinus :: Nl Double -> Nl Double -> Nl Double | |
| Plus1 :: Double -> Nl Double -> Nl Double | |
| Plus2 :: Nl Double -> Nl Double -> Nl Double | |
| Exp :: Nl Double -> Nl Double | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment