mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-01 06:12:57 +03:00
e6121e0935
This is the result of running the command: $ find . -name '*.idr' -type f -exec sed -i -E 's/\s+$//' {} + I confirmed before running it that this would not affect any markdown formatting in documentation comments.
18 lines
424 B
Idris
18 lines
424 B
Idris
module D
|
|
|
|
-- %logging 10
|
|
func1 : Applicative f => (a -> f c) -> (b -> f d) -> (a, b) -> f (c, d)
|
|
func1 fn g (ma, mb) = MkPair <$> fn ma <*> ?gmb
|
|
-- %logging 0
|
|
|
|
-- %logging 10
|
|
mfunc : (a -> Maybe c) -> (b -> Maybe d) -> (a, b) -> Maybe (c, d)
|
|
mfunc fn g (ma, mb)
|
|
= let pairapp = MkPair <$> fn ma in
|
|
pairapp <*> g mb
|
|
%logging 0
|
|
|
|
func2 : (a -> c) -> (b -> d) -> a -> b -> (c, d)
|
|
func2 f g a b = MkPair (f a) (g b)
|
|
|