delude (empty) → 0.1.0.0
raw patch · 4 files changed
+163/−0 lines, 4 filesdep +basesetup-changed
Dependencies added: base
Files
- Delude.hs +72/−0
- LICENSE +20/−0
- Setup.hs +2/−0
- delude.cabal +69/−0
+ Delude.hs view
@@ -0,0 +1,72 @@+{-# LANGUAGE NoImplicitPrelude #-}++module Delude+ (+ Boolish(..)+ , module Prelude+ ) where++import Prelude hiding ((||), (&&), (^), iff, implies, not)++class Boolish b where+ (||), (&&), (^), iff, implies :: b -> b -> b+ not :: b -> b++instance Boolish Bool where+ False || False = False+ _ || _ = True+ True && True = True+ _ && _ = False+ False ^ True = True+ True ^ False = True+ _ ^ _ = False+ True `iff` True = True+ False `iff` False = True+ _ `iff` _ = False+ True `implies` False = False+ _ `implies` _ = True+ not True = False+ not False = True++instance (Boolish b) => Boolish (x -> b) where+ f || g = \x -> (f x) || (g x)+ f && g = \x -> (f x) && (g x)+ f ^ g = \x -> (f x) ^ (g x)+ f `iff` g = \x -> (f x) `iff` (g x)+ f `implies` g = \x -> (f x) `implies` (g x)+ not f = \x -> not (f x)+++instance (Num n) => Num (a -> n) where+ a + b = \x -> a x + b x+ a - b = \x -> a x - b x+ a * b = \x -> a x * b x+ negate f = \x -> negate (f x)+ abs = \x -> abs x+ signum f = \x -> signum (f x)+ fromInteger n = \x -> (fromInteger n)++instance (Fractional f) => Fractional (a -> f) where+ f / g = \x -> (f x) / (g x)+ recip f = \x -> (fromRational 1) / (f x)+ fromRational n = \x -> (fromRational n)++instance (Floating f) => Floating (a -> f) where+ pi = \x -> pi+ exp f = \x -> exp (f x)+ log f = \x -> log (f x)+ sqrt f = \x -> sqrt (f x)+ f ** g = \x -> (f x) ** (g x)+ logBase f g = \x -> logBase (f x) (g x)+ sin f = \x -> sin (f x)+ cos f = \x -> cos (f x)+ tan f = \x -> tan (f x)+ asin f = \x -> asin (f x)+ acos f = \x -> acos (f x)+ atan f = \x -> atan (f x)+ sinh f = \x -> sinh (f x)+ cosh f = \x -> cosh (f x)+ tanh f = \x -> tanh (f x)+ asinh f = \x -> asinh (f x)+ acosh f = \x -> acosh (f x)+ atanh f = \x -> atanh (f x)
+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2016 Samuel Schlesinger++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ delude.cabal view
@@ -0,0 +1,69 @@+-- Initial delude.cabal generated by cabal init. For further +-- documentation, see http://haskell.org/cabal/users-guide/++-- The name of the package.+name: delude++-- The package version. See the Haskell package versioning policy (PVP) +-- for standards guiding when and how versions should be incremented.+-- http://www.haskell.org/haskellwiki/Package_versioning_policy+-- PVP summary: +-+------- breaking API changes+-- | | +----- non-breaking API additions+-- | | | +--- code changes with no API change+version: 0.1.0.0++-- A short (one-line) description of the package.+synopsis: Generalized the Prelude more functionally.++-- A longer description of the package.+-- description: +description: Generalized Prelude ++-- The license under which the package is released.+license: MIT++-- The file containing the license text.+license-file: LICENSE++-- The package author(s).+author: Samuel Schlesinger++-- An email address to which users can send suggestions, bug reports, and +-- patches.+maintainer: sgschlesinger@gmail.com++-- A copyright notice.+-- copyright: ++-- category: +category: Distribution++build-type: Simple++-- Extra files to be distributed with the package, such as examples or a +-- README.+-- extra-source-files: ++-- Constraint on the version of Cabal needed to build this package.+cabal-version: >=1.10+++library+ -- Modules exported by the library.+ exposed-modules: Delude+ + -- Modules included in this library but not exported.+ -- other-modules: + + -- LANGUAGE extensions used by modules in this package.+ other-extensions: NoImplicitPrelude+ + -- Other library packages from which modules are imported.+ build-depends: base >=4.8 && <4.9+ + -- Directories containing source files.+ -- hs-source-dirs: + + -- Base language which the package is written in.+ default-language: Haskell2010+