forked from haskell-foundation/foundation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFoundation.hs
196 lines (184 loc) · 5.51 KB
/
Foundation.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
-- |
-- Module : Foundation
-- License : BSD-style
-- Maintainer : Vincent Hanquez <[email protected]>
-- Stability : experimental
-- Portability : portable
--
-- I tried to picture clusters of information
-- As they moved through the computer
-- What do they look like?
--
-- Alternative Prelude
module Foundation
( -- * Standard
-- ** Operators
(Prelude.$)
, (Prelude.$!)
, (Prelude.&&)
, (Prelude.||)
, (Control.Category..)
-- ** Functions
, Prelude.not
, Prelude.otherwise
, module Foundation.Tuple
, Control.Category.id
, Prelude.maybe
, Prelude.either
, Prelude.flip
, Prelude.const
, Foundation.Primitive.Error.error
, Foundation.IO.Terminal.putStr
, Foundation.IO.Terminal.putStrLn
--, print
, getArgs
, Prelude.uncurry
, Prelude.curry
, Data.Tuple.swap
, Prelude.until
, Prelude.asTypeOf
, Prelude.undefined
, Prelude.seq
, Foundation.Primitive.NormalForm
, Foundation.Primitive.deepseq
, Foundation.Primitive.force
-- ** Type classes
, Prelude.Show
, show
, Prelude.Ord (..)
, Prelude.Eq (..)
, Prelude.Bounded (..)
, Prelude.Enum (..)
, Prelude.Functor (..)
, Integral (..)
, Fractional (..)
, HasNegation (..)
, Foundation.Class.Bifunctor.Bifunctor (..)
, Control.Applicative.Applicative (..)
, Prelude.Monad (..)
, (Control.Monad.=<<)
--, Foundation.String.IsString (..)
, IsString(..)
, IsList(..)
-- ** Numeric type classes
, Foundation.Numerical.IsIntegral (..)
, Foundation.Numerical.IsNatural (..)
, Foundation.Numerical.Signed (..)
, Foundation.Numerical.Additive (..)
, Foundation.Numerical.Subtractive (..)
, Foundation.Numerical.Multiplicative (..)
, Foundation.Numerical.IDivisible(..)
, Foundation.Numerical.Divisible(..)
-- ** Data types
, Prelude.Maybe (..)
, Prelude.Ordering (..)
, Prelude.Bool (..)
, Prelude.Char
, Prelude.IO
, Prelude.Either (..)
-- ** Numbers
, Data.Int.Int8, Data.Int.Int16, Data.Int.Int32, Data.Int.Int64
, Data.Word.Word8, Data.Word.Word16, Data.Word.Word32, Data.Word.Word64, Data.Word.Word
, Prelude.Int
, Prelude.Integer
, Natural
, Prelude.Rational
, Prelude.Float
, Prelude.Double
, CountOf(..), Offset(..)
-- ** Collection types
, UArray
, PrimType
, Array
, String
-- ** Numeric functions
-- , (Prelude.^)
, (Prelude.^^)
, Prelude.fromIntegral
, Prelude.realToFrac
-- ** Monoids
, Monoid (..)
, (<>)
-- ** Collection
, Collection(..)
, Sequential(..)
, NonEmpty
, nonEmpty
-- ** Folds
, Foldable(..)
-- ** Maybe
, Data.Maybe.mapMaybe
, Data.Maybe.catMaybes
, Data.Maybe.fromMaybe
, Data.Maybe.isJust
, Data.Maybe.isNothing
, Data.Maybe.listToMaybe
, Data.Maybe.maybeToList
-- ** Either
, Data.Either.partitionEithers
, Data.Either.lefts
, Data.Either.rights
-- ** Function
, Data.Function.on
-- ** Applicative
, (Control.Applicative.<$>)
, (Control.Applicative.<|>)
-- ** Monad
, (Control.Monad.>=>)
-- ** Exceptions
, Control.Exception.Exception (..)
, Data.Typeable.Typeable
, Control.Exception.SomeException
, Control.Exception.IOException
-- ** Proxy
, Foundation.Internal.Proxy.Proxy(..)
, Foundation.Internal.Proxy.asProxyTypeOf
-- ** Partial
, Foundation.Partial.Partial
, Foundation.Partial.partial
, Foundation.Partial.PartialError
, Foundation.Partial.fromPartial
, Foundation.Internal.Base.ifThenElse
-- ** Old Prelude Strings as [Char] with bridge back and forth
, LString
) where
import qualified Prelude
--import Prelude (Char, (.), Eq, Bool, IO)
import Data.Monoid (Monoid (..), (<>))
import Control.Applicative
import qualified Control.Category
import qualified Control.Monad
import qualified Control.Exception
import qualified Data.Typeable
import Data.Word (Word8, Word16, Word32, Word64, Word)
import Data.Int (Int8, Int16, Int32, Int64)
import Foundation.String (String)
import Foundation.Array (UArray, Array, PrimType)
import Foundation.Collection (Collection(..), Sequential(..), NonEmpty, nonEmpty, Foldable(..))
import qualified Foundation.IO.Terminal
import GHC.Exts (IsString(..))
import Foundation.Internal.IsList
import qualified Foundation.Internal.Base (ifThenElse)
import qualified Foundation.Internal.Proxy
import qualified Foundation.Primitive.Error
import qualified Foundation.Numerical
import qualified Foundation.Partial
import Foundation.Tuple
import qualified Foundation.Class.Bifunctor
import Foundation.Primitive.Types.OffsetSize (CountOf(..), Offset(..))
import qualified Foundation.Primitive
import Foundation.Primitive.Show
import Foundation.Internal.NumLiteral
import Foundation.Internal.Natural
import qualified Data.Maybe
import qualified Data.Either
import qualified Data.Function
import qualified Data.Tuple
import qualified System.Environment
import qualified Data.List
default (Prelude.Integer, Prelude.Double)
-- | Alias to Prelude String ([Char]) for compatibility purpose
type LString = Prelude.String
-- | Returns a list of the program's command line arguments (not including the program name).
getArgs :: Prelude.IO [String]
getArgs = (Data.List.map fromList <$> System.Environment.getArgs)