Demo entry 5174600

pointed

   

Submitted by anonymous on Jun 08, 2016 at 00:55
Language: Haskell. Code size: 252 Bytes.

class Pointed a where
null :: a
isNull :: a -> Bool

instance Pointed (Bag a) where
null = mempty
isNull = (== []) . elems

instance Pointed ([Maybe a]) where
null = Nothing
isNull = (== Nothing)

lift :: [a] -> [Maybe a]
lift  = fmap Just

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).