Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Monoid and friends
--ghc 7.10 class Semigroup a where -- (<>) :: a -> a -> a -- associative class Semigroup a => Monoid a where -- (<>) :: a -> a -> a -- mempty <> x == x <> mempty = x -- associative -- identity class Monoid a => Group a where -- (<>) :: a -> a -> a -- mempty <> x == x <> mempty = x -- x <> inv x = mempty -- inv x <> x = mempty -- associative -- identity -- inverses cancel out class Monoid a => Semilattice a where -- (<>) :: a -> a -> a -- mempty <> x == x <> mempty = x -- x <> y == y <> x -- x <> x = x -- associative -- identity -- commutative (commutativity does not imply associativity: (x+y)/2 = (y+x)/2 /= x + (y / 2) -- idempotent
run
|
edit
|
history
|
help
0
Factorial in haskell
appending and prepending list
ex3
State
Pi
mySqrt
Lambda Parser with long ids
Znajdz trójkąty prostokątne
ad-hoc braille dot rendering
project euler 1, haskel