Permalink
Browse files

Initial patch

Ignore-this: 9ecd22a90a986f09be8b31d3a73ce98d

darcs-hash:20091221114147-cab80-7201c6edaefb8af43a63b1319feecc37dc8ba5ef.gz
  • Loading branch information...
0 parents commit 2d544b3c6660cb8f8c4cc43e170858c5c38b3e33 @roelvandijk committed Dec 21, 2009
Showing with 297 additions and 0 deletions.
  1. +28 −0 Control/Applicative/Unicode.hs
  2. +18 −0 Control/Category/Unicode.hs
  3. +26 −0 Data/Monoid/Unicode.hs
  4. +31 −0 LICENSE
  5. +162 −0 Prelude/Unicode.hs
  6. +3 −0 Setup.hs
  7. +29 −0 base-unicode-symbols.cabal
@@ -0,0 +1,28 @@
+{-# LANGUAGE UnicodeSyntax #-}
+
+module Control.Applicative.Unicode
+ ( (⊛)
+ , (∅)
+ ) where
+
+import Control.Applicative ( Applicative
+ , Alternative
+ , (<*>)
+ , empty
+ )
+
+{- |
+(&#x229B;) = '<*>'
+
+U+229B, CIRCLED ASTERISK OPERATOR
+-}
+(⊛) Applicative f f (α β) f α f β
+(⊛) = (<*>)
+
+{- |
+(&#x2205;) = 'empty'
+
+U+2205, EMPTY SET
+-}
+(∅) Alternative f f α
+(∅) = empty
@@ -0,0 +1,18 @@
+{-# LANGUAGE UnicodeSyntax #-}
+
+module Control.Category.Unicode
+ ( (∘)
+ ) where
+
+import Prelude hiding ( (.) )
+import Control.Category
+
+{- |
+(&#x2218;) = ('.')
+
+U+2218, RING OPERATOR
+-}
+(∘) Category cat cat b c cat a b cat a c
+(∘) = (.)
+
+infixr 9
@@ -0,0 +1,26 @@
+{-# LANGUAGE UnicodeSyntax #-}
+
+module Data.Monoid.Unicode
+ ( (∅)
+ , (⊕)
+ ) where
+
+import Data.Monoid ( Monoid, mempty, mappend )
+
+{- |
+(&#x2205;) = 'mempty'
+
+U+2205, EMPTY SET
+-}
+(∅) Monoid α α
+(∅) = mempty
+
+{- |
+(&#x2295;) = 'mappend'
+
+U+2295, CIRCLED PLUS
+-}
+(⊕) Monoid α α α α
+(⊕) = mappend
+
+infixr 6
31 LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2009 Roel van Dijk
+
+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.
+
+ * The name of Roel van Dijk and the names of contributors may NOT
+ 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.
@@ -0,0 +1,162 @@
+{-# LANGUAGE UnicodeSyntax #-}
+
+module Prelude.Unicode
+ ( (¬), (∧), (∨)
+ , (≡), (≢)
+ , (≤), (≥), (≮), (≯)
+ , π
+ , (÷), (⋅)
+ , (∘)
+ , (∈), (∉)
+ , (⊥)
+ ) where
+
+-------------------------------------------------------------------------------
+-- Fixities
+-------------------------------------------------------------------------------
+
+infixr 2
+infixr 3
+infix 4
+infix 4
+infix 4
+infix 4
+infix 4
+infix 4
+infix 4
+infix 4
+infixl 7 ÷
+infixl 7
+infixr 9
+
+-------------------------------------------------------------------------------
+-- Symbols
+-------------------------------------------------------------------------------
+
+{- |
+(&#x00AC;) = 'not'
+
+U+00AC, NOT SIGN
+-}
+(¬) Bool Bool
+(¬) = not
+
+{- |
+(&#x2227;) = ('&&')
+
+U+2227, LOGICAL AND
+-}
+(∧) Bool Bool Bool
+(∧) = (&&)
+
+{- |
+(&#x2228;) = ('||')
+
+U+2228, LOGICAL OR
+-}
+(∨) Bool Bool Bool
+(∨) = (||)
+
+{- |
+(&#x2261;) = ('==')
+
+U+2261, IDENTICAL TO
+-}
+(≡) Eq α α α Bool
+(≡) = (==)
+
+{- |
+(&#x2262;) = ('/=')
+
+U+2262, NOT IDENTICAL TO
+-}
+(≢) Eq α α α Bool
+(≢) = (/=)
+
+{- |
+(&#x2264;) = ('<=')
+
+U+2264, LESS-THAN OR EQUAL TO
+-}
+(≤) Ord α α α Bool
+(≤) = (<=)
+
+{- |
+(&#x2265;) = ('>=')
+
+U+2265, GREATER-THAN OR EQUAL TO
+-}
+(≥) Ord α α α Bool
+(≥) = (>=)
+
+{- |
+(&#x226E;) = ('>=')
+
+U+226E, NOT LESS-THAN
+-}
+(≮) Ord α α α Bool
+(≮) = (>=)
+
+{- |
+(&#x226F;) = ('<=')
+
+U+226F, NOT GREATER-THAN
+-}
+(≯) Ord α α α Bool
+(≯) = (<=)
+
+{- |
+&#x03C0; = 'pi'
+
+U+03C0, GREEK SMALL LETTER PI
+-}
+π Floating α α
= pi
+
+{- |
+(&#x00F7;) = ('/')
+
+U+00F7, DIVISION SIGN
+-}
+(÷) Fractional α α α α
+(÷) = (/)
+
+{- |
+(&#x22C5;) = ('*')
+
+U+22C5, DOT OPERATOR
+-}
+(⋅) Num α α α α
+(⋅) = (*)
+
+{- |
+(&#x2218;) = ('.')
+
+U+2218, RING OPERATOR
+-}
+(∘) (b c) (a b) (a c)
+(∘) = (.)
+
+{- |
+(&#x2208;) = 'elem'
+
+U+2208, ELEMENT OF
+-}
+(∈) Eq α α [α] Bool
+(∈) = elem
+
+{- |
+x &#x2209; y = 'not' (x &#x2208; y)
+
+U+2209, NOT AN ELEMENT OF
+-}
+(∉) Eq α α [α] Bool
+x y = not (x y)
+
+{- |
+(&#x22A5;) = 'undefined'
+
+U+22A5, UP TACK
+-}
+(⊥) α
+(⊥) = undefined
@@ -0,0 +1,3 @@
+import Distribution.Simple
+
+main = defaultMain
@@ -0,0 +1,29 @@
+name: base-unicode-symbols
+version: 0.1
+cabal-version: >=1.6
+build-type: Simple
+stability: experimental
+author: Roel van Dijk
+maintainer: vandijk.roel@gmail.com
+copyright: (c) 2009 Roel van Dijk
+license: BSD3
+license-file: LICENSE
+category:
+synopsis: Unicode alternatives for common functions and operators
+description:
+
+ This package defines new symbols for a number of functions and
+ operators in the base package.
+
+ .
+
+ All symbols are documented with their actual definition and
+ information regarding their Unicode code point. They should be
+ completely interchangeable with their definitions.
+
+Library
+ exposed-modules: Control.Applicative.Unicode
+ , Control.Category.Unicode
+ , Data.Monoid.Unicode
+ , Prelude.Unicode
+ build-depends: base >= 3.0.3.1 && < 4.3

0 comments on commit 2d544b3

Please sign in to comment.