codesnippets:flexibleinstances
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| codesnippets:flexibleinstances [2021/04/12 19:39] – f2b216 | codesnippets:flexibleinstances [2025/10/08 00:48] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== {-# LANGUAGE FlexibleInstances #-} ====== | ====== {-# LANGUAGE FlexibleInstances #-} ====== | ||
| + | ~~DISCUSSION~~ | ||
| * allows to implement instances that are of form (T a1 ... an) where a1 ... an are particlar types (not type variables) | * allows to implement instances that are of form (T a1 ... an) where a1 ... an are particlar types (not type variables) | ||
| * [Double] instead of [a] | * [Double] instead of [a] | ||
| - | * implies extension '' | + | * implies |
| * example: | * example: | ||
| * code:< | * code:< | ||
| Line 143: | Line 144: | ||
| x2 = fMy (C 1.3) (C 2.5) | x2 = fMy (C 1.3) (C 2.5) | ||
| </ | </ | ||
| - | * compiles, error and warning free, with compiler: GHC 8.10.4 using -Wall | + | * compiles, error and warning free, with compiler: GHC 8.10.4, using compiler option |
| * executes, with output:< | * executes, with output:< | ||
| [1.3, | [1.3, | ||
| Line 149: | Line 150: | ||
| </ | </ | ||
| + | |||
| + | ===== ✎ ===== | ||
| + | ~~DISCUSSION~~ | ||
codesnippets/flexibleinstances.1618249193.txt.gz · Last modified: (external edit)
