Created
September 1, 2017 15:19
-
-
Save joneshf/c5b7798ac4d50108478eead4f2e83771 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
times :: forall a f. Semigroup f a (Int -> a -> a) | |
times n x = times n x | |
-- Adding explicit types doesn't work either | |
-- times' :: forall a f. Semigroup f a (Int -> a -> a) | |
-- times' n x = (times' :: Semigroup f a (Int -> a -> a)) n x | |
-- This doesn't work either | |
-- times'' :: forall a f. Associate f a => Op f a => Int -> a -> a | |
-- times'' n x = times'' n x | |
class Op f a where | |
op :: f a -> f a -> f a | |
class Op f a <= Associate f a | |
type Magma f a b = Op f a => b | |
type Semigroup f a b = Associate f a => Magma f a b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment