Quick actions

cmd+k|ctrl+k

Navigation

Languages

FunctionalDependencies - Naive

Snippet info

Language

Haskell

Visibility

public

Author

homam

Created

2018-03-13T13:43:21Z

Updated

2018-03-13T13:43:21Z

{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE FlexibleInstances          #-}
{-# LANGUAGE FunctionalDependencies     #-}

class AnyComp a b | a -> b  where
    (.==.) :: a -> b -> Bool
    
instance Eq a => AnyComp a (Maybe a) where
    a .==. (Just b) = a == b
    _ .==. _        = False

main = do
    print (False .==. Nothing)
    print (False .==. Just False)
INFO