compiling-to-categories / concat

Compiling to Categories
http://conal.net/papers/compiling-to-categories
BSD 3-Clause "New" or "Revised" License
431 stars 49 forks source link

buildDictionary isn't finding instances in the module being compiled #20

Closed conal closed 6 years ago

conal commented 6 years ago

Example:


data Foo = Foo Double

negateFoo :: Unop Foo
negateFoo (Foo x) = Foo (negate x)

instance HasRep Foo where
  type Rep Foo = R
  abst x = Foo x
  repr (Foo x) = x

foo1 :: Foo -> Foo :* (Foo -> Foo)
foo1 = andDerF negateFoo