Skip to content

Instantly share code, notes, and snippets.

@MarcelineVQ
Created April 21, 2020 23:30
Show Gist options
  • Select an option

  • Save MarcelineVQ/a0c1dc1093f404aef2b158b8bf595270 to your computer and use it in GitHub Desktop.

Select an option

Save MarcelineVQ/a0c1dc1093f404aef2b158b8bf595270 to your computer and use it in GitHub Desktop.
module Main
Semigroup b => Semigroup (a -> b) where
f <+> g = \x => f x <+> g x
Monoid b => Monoid (a -> b) where
neutral = const neutral
[all] Semigroup Bool where
x <+> y = x && y
via : Semigroup b -> Semigroup (a -> b)
via r = let _ = r in %search
alphaNum : Char -> Bool
-- alphaNum = (isDigit <+> isAlpha) @{let _ = all in %search}
alphaNum = (isDigit <+> isAlpha) @{via all}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment