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
appending and prepending list
tried some polynoms 2: now with some `*` and foldr(-p)
perfect numbers
ad-hoc braille dot rendering
Removed input
Forkitup
first haskell program
State
equiv_strings
(Int,Int) -> Bool plot