Commit d9deb5db authored by Tim Steenvoorden's avatar Tim Steenvoorden
Browse files

add Arrays: lazy, unboxed and strict

parent 7fdd86b6
...@@ -11,15 +11,16 @@ import Data.Function ...@@ -11,15 +11,16 @@ import Data.Function
import Data.Tuple import Data.Tuple
import Data.Enum import Data.Enum
import Data.Array import Data.Array
// import Data.Array.Unboxed import Data.Array.Unboxed
// import Data.Array.Strict import Data.Array.Strict
import Data.String
import Algebra.Order import Algebra.Order
import Algebra.Group import Algebra.Group
import Algebra.Ring import Algebra.Ring
import Algebra.Lattice import Algebra.Lattice
// import Text.Show
// import System.Console // import System.Console
// import System.File // import System.File
// import System.Process // import System.Process
...@@ -3,7 +3,8 @@ definition module Data.Array ...@@ -3,7 +3,8 @@ definition module Data.Array
from Algebra.Order import class Eq, class Ord from Algebra.Order import class Eq, class Ord
from Algebra.Group import class Semigroup, class Monoid from Algebra.Group import class Semigroup, class Monoid
import Clean._Array // import _DataArrayInternal
import _SystemArray
/// # Definition /// # Definition
......
...@@ -5,7 +5,8 @@ import Data.Function ...@@ -5,7 +5,8 @@ import Data.Function
import Algebra.Order import Algebra.Order
import Algebra.Group import Algebra.Group
import Clean._Array // import _DataArrayInternal
import _SystemArray
/// # Instances /// # Instances
......
definition module Data.Array.Strict
// import _DataArrayStrictInternal
import _SystemArray
/// # Definition
// :: {! }
//BUILTIN
/// # Instances
// instance Eq {!e} | Eq e
// instance Ord {!e} | Ord e
//
// instance Semigroup {!e}
// instance Monoid {!e}
implementation module Data.Array.Strict
definition module Data.Array.Unboxed
from Algebra.Order import class Eq, class Ord
from Algebra.Group import class Semigroup, class Monoid
// import _DataArrayUnboxedInternal
import _SystemArray
/// # Definition
// :: {#}
//BUILTIN
/// # Instances
// instance Eq {#Bool}
instance Eq {#Char}
// instance Eq {#Nat}
// instance Eq {#Int}
// instance Eq {#Real}
// instance Ord {#Bool}
instance Ord {#Char}
// instance Ord {#Nat}
// instance Ord {#Int}
// instance Ord {#Real}
// instance Semigroup {#Bool}
instance Semigroup {#Char}
// instance Semigroup {#Nat}
// instance Semigroup {#Int}
// instance Semigroup {#Real}
// instance Monoid {#Bool}
instance Monoid {#Char}
// instance Monoid {#Nat}
// instance Monoid {#Int}
// instance Monoid {#Real}
implementation module Data.Array.Unboxed
import Data.Function
import Algebra.Order
import Algebra.Group
import Clean.Prim
// import _DataArrayUnboxedInternal
import _SystemArray
/// ## Instances
// instance Eq {#Bool} where
// (==) xs ys = inline_equal xs ys
instance Eq {#Char} where
(==) xs ys = prim_eqString xs ys
// instance Eq {#Nat} where
// (==) xs ys = inline_equal xs ys
// instance Eq {#Int} where
// (==) xs ys = inline_equal xs ys
// instance Eq {#Real} where
// (==) xs ys = inline_equal xs ys
// instance Ord {#Bool} where
// (<) xs ys = inline_lesser xs ys
instance Ord {#Char} where
(<) xs ys = prim_ltString xs ys
// instance Ord {#Nat} where
// (<) xs ys = inline_lesser xs ys
// instance Ord {#Int} where
// (<) xs ys = inline_lesser xs ys
// instance Ord {#Real} where
// (<) xs ys = inline_lesser xs ys
// instance Semigroup {#Bool} where
// (+) xs ys = inline_append xs ys
instance Semigroup {#Char} where
(+) xs ys = prim_concatString xs ys
// instance Semigroup {#Nat} where
// (+) xs ys = inline_append xs ys
// instance Semigroup {#Int} where
// (+) xs ys = inline_append xs ys
// instance Semigroup {#Real} where
// (+) xs ys = inline_append xs ys
// instance Monoid {#Bool} where
// neutral = {# }
instance Monoid {#Char} where
neutral = prim_emptyString
// instance Monoid {#Nat} where
// neutral = {# }
// instance Monoid {#Int} where
// neutral = {# }
// instance Monoid {#Real} where
// neutral = {# }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment