Created
February 14, 2017 19:47
-
-
Save gnull/1c0d984e0054a2f28bebdd8091a51e96 to your computer and use it in GitHub Desktop.
Sum of two Maybe values in CLaSH
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
module Maybe where | |
import Data.Functor | |
import Control.Applicative | |
import CLaSH.Prelude | |
sol :: Maybe Int -> Maybe Int -> Maybe Int | |
sol a b = (+) <$> a <*> b | |
topEntity :: (Maybe Int, Maybe Int) -> Maybe Int | |
topEntity = uncurry sol |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment