User Tools

Site Tools


codesnippets:prelude:basictypeclasses

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
codesnippets:prelude:basictypeclasses [2021/04/10 18:51] – created f2b216codesnippets:prelude:basictypeclasses [2021/04/10 19:49] (current) – removed f2b216
Line 1: Line 1:
-====== Basic type classes ====== 
  
- 
-===== Eq ===== 
- 
-  * source: [[https://hackage.haskell.org/package/base-4.15.0.0/docs/Prelude.html#g:4|class Eq a]] 
-  * main functions 
-    * <code Haskell>(==) :: a -> a -> Bool</code> ''infix 4'', true if equal otherwise false 
-    * <code Haskell>(/=) :: a -> a -> Bool</code> ''infix 4'', false if equal otherwise true 
-  * Minimal complete definition: either == or /=. 
- 
-  * source [[https://hackage.haskell.org/package/base-4.15.0.0/docs/Prelude.html#t:Ord|class Eq a => Ord a]] 
-  * main functions 
-    * <code Haskell>compare :: a -> a -> Ordering</code>, LT if first parameter is less then second parameter, and EQ if first parameter is equal second parameter, and GT if first parameter is greater then second parameter 
-    * <code Haskell>(<) :: a -> a -> Bool</code> ''infix 4'', true if first parameter is less than second parameter otherwise false 
-    * <code Haskell>(<=) :: a -> a -> Bool</code> ''infix 4'', true if first parameter is equal or less than second parameter otherwise false 
-    * <code Haskell>(>) :: a -> a -> Bool</code> ''infix 4'', true if first parameter is greater than second parameter otherwise false 
-    * <code Haskell>(>=) :: a -> a -> Bool</code> ''infix 4'', true if first parameter is equal or greater than second parameter otherwise false 
-    * <code Haskell>max :: a -> a -> a</code> the greater or equal value of both parameters 
-    * <code Haskell>min :: a -> a -> a</code> the smaller or equal value of both parameters 
-  * Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types. 
codesnippets/prelude/basictypeclasses.1618073487.txt.gz · Last modified: (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki