Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Explicit type signature for `c` in function `derive` #5

Closed
wants to merge 2 commits into from

2 participants

@MedeaMelana

Please see #4 for details.

@sebastiaanvisser

Hey Martijn, just noticed this pull request today.

I'll look into it.

@sebastiaanvisser

Hey, I just fixed this problem by removing the untyped local let binding from the TH code. I'll upload the package to hackage soon. Thanks for the bugreport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/Data/Label/Derive.hs
View
3  src/Data/Label/Derive.hs
@@ -5,6 +5,7 @@
, FlexibleContexts
, FlexibleInstances
, TypeOperators
+ , RankNTypes
#-}
module Data.Label.Derive
( mkLabels
@@ -101,7 +102,7 @@ derive signatures concrete tyname vars total ((field, _, fieldtyp), ctors) =
where
mono = forallT prettyVars (return []) [t| $(inputType) :~> $(return prettyFieldtyp) |]
poly = forallT forallVars (return []) [t| (ArrowChoice $(arrow), ArrowZero $(arrow)) => Lens $(arrow) $(inputType) $(return prettyFieldtyp) |]
- body = [| let c = zeroArrow ||| returnA in lens (c . $(getter)) (c . $(setter)) |]
+ body = [| let c :: forall b d (~>). (ArrowChoice (~>), ArrowZero (~>)) => Either b d ~> d; c = zeroArrow ||| returnA in lens (c . $(getter)) (c . $(setter)) |]
where
getter = [| arr (\ p -> $(caseE [|p|] (cases (bodyG [|p|] ) ++ wild))) |]
setter = [| arr (\(v, p) -> $(caseE [|p|] (cases (bodyS [|p|] [|v|]) ++ wild))) |]
Something went wrong with that request. Please try again.