Skip to content

Instantly share code, notes, and snippets.

@rjmholt
Created February 4, 2017 15:27
Show Gist options
  • Save rjmholt/96d9e8fb8ede60b75c1b9a09e1955037 to your computer and use it in GitHub Desktop.
Save rjmholt/96d9e8fb8ede60b75c1b9a09e1955037 to your computer and use it in GitHub Desktop.
{-# LANGUAGE
MultiParamTypeClasses,
FunctionalDependencies,
FlexibleInstances,
TypeFamilies #-}
class Mul' a b where
type MulT a b
mul' :: a -> b -> MulT a b
instance Mul' a b => Mul' a [b] where
type MulT a [b] = [MulT a b]
mul' a = map (mul' a)
g b x y = if b then mul' x [y] else y
main :: IO ()
main = return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment