articles icon indicating copy to clipboard operation
articles copied to clipboard

Inferred (rank 1) type of moeb could be more general

Open Jashweii opened this issue 5 years ago • 0 comments

With an explicit type signature, moeb can be given a more general type

moeb :: ((forall b . (a -> b) -> b) -> c -> a) -> c -> a
moeb f x = go where go = f ($ go) x

e.g. compare moeb (\a -> bimap a a) with/without the explicit rank 3(?) signature - the rank 3 version allows a fixpoint with different parameters.

Jashweii avatar Aug 10 '20 16:08 Jashweii