Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on f g = curry $ (. bimap g g) $ uncurry f
- on :: forall (co :: * -> Constraint) a1 a2 b c .
- (co a1, co a2) =>
- (b -> b -> c)
- -> (forall a . co a => a -> b)
- -> a1 -> a2 -> c
- > :t (+) `on` toInteger`
- • Couldn't match type ‘c’ with ‘Integer’
- ‘c’ is untouchable
- inside the constraints: co a
- bound by a type expected by the context:
- forall a. co a => a -> c
- at <interactive>:1:1-18
- ‘c’ is a rigid type variable bound by
- the inferred type of it :: (co a1, co a2, Num c) => a1 -> a2 -> c
- at <interactive>:1:1
- Possible fix: add a type signature for ‘it’
- Expected type: a -> c
- Actual type: a -> Integer
- • In the second argument of ‘on’, namely ‘toInteger’
- In the expression: (+) `on` toInteger
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement