-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi, the title is the error message I get when I try to write a function like:
c :: forall r. Forall (r :- "pitch") Default => Rec r
c = pitch := C .| (def :: Rec (r :- "pitch"))
The complete error message is:
src/LibCTRex.hs:54:5: Couldn't match type ‘r’ with ‘Extend "pitch" Pitch (r :- "pitch")’ …
‘r’ is a rigid type variable bound by
the type signature for c :: Forall (r :- "pitch") Default => Rec r
at /home/carlo/code/haskell/prova/musicRecord/src/LibCTRex.hs:53:13
Expected _type:_ Rec r
Actual type: Rec (("pitch" '::= Pitch) :| (r :- "pitch"))
Relevant bindings include
c :: Rec r
(bound at /home/carlo/code/haskell/prova/musicRecord/src/LibCTRex.hs:54:1)
In the expression: pitch := C .| (def :: Rec (r :- "pitch"))
In an equation for ‘c’:
c = pitch := C .| (def :: Rec (r :- "pitch"))
Compilation failed.
Now, shouldn't there be an isomorphism, in general, between those types? How
could I write one on my own?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels