Last active
March 16, 2018 00:39
-
-
Save dalaing/39b92cecd48ddb41ec7306080d981234 to your computer and use it in GitHub Desktop.
Tagged final backpack shennanigans
This file contains 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
-- final-bp-base-eval | |
module Base where | |
import Data.Functor.Identity | |
lit :: a -> Identity a | |
lit = Identity | |
add :: Num a => Identity a -> Identity a -> Identity a | |
add x y = (+) <$> x <*> y |
This file contains 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
-- final-bp-base-sig | |
signature Base where | |
import Repr | |
lit :: a -> Repr a | |
add :: Num a => Repr a -> Repr a -> Repr a |
This file contains 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
-- final-bp-mul-eval | |
module Mul where | |
import Data.Functor.Identity | |
mul :: Num a => Identity a -> Identity a -> Identity a | |
mul x y = (*) <$> x <*> y |
This file contains 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
-- final-bp-mul-sig | |
signature Mul where | |
import Repr | |
mul :: Num a => Repr a -> Repr a -> Repr a |
This file contains 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
-- final-bp-eval | |
module Repr where | |
import Data.Functor.Identity | |
type Repr = Identity |
This file contains 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
-- final-bp-repr-sig | |
signature Repr where | |
data Repr a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment