prelude-edsl (empty) → 0.1
raw patch · 4 files changed
+124/−0 lines, 4 filesdep +basesetup-changed
Dependencies added: base
Files
- LICENSE +30/−0
- Prelude/EDSL.hs +43/−0
- Setup.hs +2/−0
- prelude-edsl.cabal +49/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2015, Emil Axelsson++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Emil Axelsson nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Prelude/EDSL.hs view
@@ -0,0 +1,43 @@+-- | A subset of the "Prelude" motivated by deeply embedded domain-specific+-- languages++module Prelude.EDSL+ ( Bool (..)+ , Double+ , Float+ , Int+ , IO+ , Integer+ , Maybe (..)+ , String++ , Bounded (..)+ , Fractional (..)+ , Functor (..)+ , Monad (..)+ , Num (..)+ , Read (..)+ , Show (..)++ , (.)+ , ($)+ , asTypeOf+ , const+ , curry+ , flip+ , fst+ , id+ , otherwise+ , print+ , putStr+ , putStrLn+ , readFile+ , snd+ , subtract+ , toInteger+ , toRational+ , uncurry+ , undefined+ , writeFile+ ) where+
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ prelude-edsl.cabal view
@@ -0,0 +1,49 @@+name: prelude-edsl+version: 0.1+synopsis: An EDSL-motivated subset of the Prelude+description: "Prelude.EDSL" exports a small subset of the "Prelude":+ some standard types and classes plus a small number of+ convenience functions.+ .+ The motivation for this module is that it is common for+ deeply embedded domain-specific languages (EDSLs) to+ redefine identifiers from the "Prelude", so EDSL users must+ hide the "Prelude" in their programs. However, there are+ certain useful things from the "Prelude" that are usually+ not redefined -- function composition being one example --+ so it becomes quite awkward to have to hide everything from+ the "Prelude".+ .+ The reason for exporting e.g the @Num@ class but not @Ord@+ is that it is possible to give an instance for deep+ embeddings of the former but not the latter. For example,+ assuming @Exp@ is the type of a deep embedding, we can have+ .+ > (+) :: Exp -> Exp -> Exp+ .+ but not+ .+ > (<) :: Exp -> Exp -> Exp+ .+ (because @(<)@ has a @Bool@ result, regardless of the type+ of the arguments).+license: BSD3+license-file: LICENSE+author: Emil Axelsson+maintainer: emax@chalmers.se+copyright: Copyright (c) 2015, Emil Axelsson+homepage: https://github.com/emilaxelsson/prelude-edsl+bug-reports: https://github.com/emilaxelsson/operational-alacarte/issues+category: Language+build-type: Simple+cabal-version: >=1.10++source-repository head+ type: git+ location: git@github.com:emilaxelsson/prelude-edsl.git++library+ exposed-modules: Prelude.EDSL+ build-depends: base >=4.8 && <4.9+ default-language: Haskell2010+