Skip to content

Instantly share code, notes, and snippets.

@gnull
Created February 14, 2017 19:47
Show Gist options
  • Save gnull/1c0d984e0054a2f28bebdd8091a51e96 to your computer and use it in GitHub Desktop.
Save gnull/1c0d984e0054a2f28bebdd8091a51e96 to your computer and use it in GitHub Desktop.
Sum of two Maybe values in CLaSH
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