roelvandijk / base-unicode-symbols Goto Github PK
View Code? Open in Web Editor NEWUnicode alternatives for common functions and operators
Home Page: http://haskell.org/haskellwiki/Unicode-symbols
License: Other
Unicode alternatives for common functions and operators
Home Page: http://haskell.org/haskellwiki/Unicode-symbols
License: Other
Hi, I've tried to build this package. But I fail doing that, however it's not the usual dependency problem, it's just that ghc doesn't seem to think the code is correct at all, it gives errors!
I use Ubuntu 10.10. I've tried to wipe out both .cabal and .ghc and still this problem. I use the default haskell installation provided by Ubuntu repos.
Here is a link to paste-bin where I've run some commands that gives the error message and ghc version and more. http://hpaste.org/paste/45906/installing_baseunicodesymbol#p45911
Just a side note, is there any other files than .ghc or .cabal that might help to erase? I don't know if I've used cabal --global
at any point (which might be interfering maybe?)
My haskell setup is of no importance, i can wipe out any files for experimenting.
I have some operator suggestions that are probably all silly, tasteless and/or wrong. Maybe you will find some make sense. At the very least, you can get a chuckle at the suggestions.
For Control.Applicative.Unicode:
\u229A = <$>
-- The circled ring operator has the sense of function composition, which is analogous to $. Admittedly, this is a difficult choice, but there doesn't seem to be another symbol that indicates the concept of mapping much better.
\u22d6, \u22d7 = <*, *>
-- They look very similar, and there is no combination with * and > in Unicode that I could find
\u29b6 = <|>
-- In keeping with the circled asterisk for <*>
For Control.Monad.Unicode:
\u2906, \u2907 = <=<, >=>
-- The only double-struck arrows with something resembling a tail.
For Control.Arrow:
\u2a55 = &&&
-- Sort of looks like three logical ands, in keeping with the theme
\u2295 = <+>
-- In line with Control.Applicative
And I'm sure now I'll be burned at the stake for trying to help turn Haskell into APL! It's all in good fun, isn't it?
I personally always define this for myself:
(◇) ∷ Semigroup α ⇒ α → α → α
(◇) = (<>)
{-# INLINE (◇) #-}
infixr 6 ◇
What do you think about to include it to this package? There are two such symbols which look pretty similar: (◇)
and (⋄)
. You could add both:
(◇) ∷ Semigroup α ⇒ α → α → α
(◇) = (<>)
{-# INLINE (◇) #-}
infixr 6 ◇
(⋄) ∷ Semigroup α ⇒ α → α → α
(⋄) = (<>)
{-# INLINE (⋄) #-}
infixr 6 ⋄
But I prefer first one since second one is pretty similar to (∘)
because it's too small.
Hi,
Any thought on this ?
cabal install base-unicode-symbols
Resolving dependencies...
Notice: installing into a sandbox located at /home/perso/site/.cabal-sandbox
Configuring base-unicode-symbols-0.2.2.4...
Building base-unicode-symbols-0.2.2.4...
Failed to install base-unicode-symbols-0.2.2.4
Last 10 lines of the build log ( /home/perso/site/.cabal-sandbox/logs/base-unicode-symbols-0.2.2.4.log ):
[ 6 of 12] Compiling Data.Eq.Unicode ( Data/Eq/Unicode.hs, dist/dist-sandbox-10fda7d8/build/Data/Eq/Unicode.o )
[ 7 of 12] Compiling Data.Bool.Unicode ( Data/Bool/Unicode.hs, dist/dist-sandbox-10fda7d8/build/Data/Bool/Unicode.o )
[ 8 of 12] Compiling Prelude.Unicode ( Prelude/Unicode.hs, dist/dist-sandbox-10fda7d8/build/Prelude/Unicode.o )
[ 9 of 12] Compiling Control.Monad.Unicode ( Control/Monad/Unicode.hs, dist/dist-sandbox-10fda7d8/build/Control/Monad/Unicode.o )
[10 of 12] Compiling Control.Category.Unicode ( Control/Category/Unicode.hs, dist/dist-sandbox-10fda7d8/build/Control/Category/Unicode.o )
[11 of 12] Compiling Control.Arrow.Unicode ( Control/Arrow/Unicode.hs, dist/dist-sandbox-10fda7d8/build/Control/Arrow/Unicode.o )
[12 of 12] Compiling Control.Applicative.Unicode ( Control/Applicative/Unicode.hs, dist/dist-sandbox-10fda7d8/build/Control/Applicative/Unicode.o )
In-place registering base-unicode-symbols-0.2.2.4...
Creating package registration file:
/tmp/pkgConf-base-unicode-symbols-0.2.211565.4
cabal: Error: some packages failed to install:
base-unicode-symbols-0.2.2.4 failed during the final install step. The
exception was:
/tmp/pkgConf-base-unicode-symbols-0.2.211565.4: hGetContents: invalid argument
Env:
OS: Centos 6.5 2.6.32
GHC: 7.8.2
Cabal: 1.20
Regards
I have found in Data.List.Unicode some symbols that are not exact synonyms for existing functions (∆, ∌, ∋), so I thought it is fine to suggest some new symbols that are also not synonyms for existing functions. I think the three symbols that follow should be placed in Data.Bool.Unicode, and the two next in Prelude.Unicode (because that's where mod
is located).
exclusive disjunction
U+22BB: XOR
a ⊻ b = (a || b) && not (a && b)
alternative denial
U+22BC: NAND
(⊼) = not . (&&)
joint denial
U+22BD: NOR
(⊽) = not . (||)
U+2223: DIVIDES
a ∣ b = mod a b == 0
U+2224: DOES NOT DIVIDE
a ∤ b = not . (∣)
I would also suggest adding the following, in Prelude.Unicode because that's where sqrt
is.
square root
U+221A: SQUARE ROOT
(√) = sqrt
Finally, I found the following silly cases that I am presenting here for enjoyment:
U+26A0: WARNING SIGN
(⚠) = error
U+22DA: LESS-THAN EQUAL TO OR GREATER-THAN
(⋚) = (==)
U+22DB: GREATER-THAN EQUAL TO OR LESS-THAN
(⋛) = (==)
U+2A75: TWO CONSECUTIVE EQUALS SIGNS
(⩵) = (==)
U+22BA: INTERCALATE
(⊺) = intercalate
Last time I tried to use symbols in .stylish-haskell.yml, it didn't understand symbol functions, is there an auto-updater for these?
{-|
(×) = ('*')
U+00D7, MULTIPLICATION SIGN
-}
(×) ∷ Num α ⇒ α → α → α
(×) = (*)
{-# INLINE (×) #-}
Hi,
When I type this code:
{-# LANGUAGE UnicodeSyntax #-}
module FrenchPhon.FrenchRules where
import Data.List.Unicode
removeFinalConsonnant ∷ String → String
removeFinalConsonnant s = case applyGlobalRule (reverse s) of
Nothing → applySpecificRules s
Just s → s
where applySpecificRules s = s
applyGlobalRule s = if all isConsonnant (tak 2 s)
then Just (reverse ∘ init) s
else Nothing
isConsonnant ∷ Char → Bool
isConsonnant x = x ∈
['a', 'e', 'i', 'o', 'u', 'y']
I get a parse error about the element of symbol.
What I missed ?
Thanks
The last release on Hackage is about two and a half years old now! It would be nice to have a newer version sometime soon.
Hi, thank you again for your project! Currently there is type ℤ = Integer
but no type ℕ = Natural
for the Natural
type which is in base (since 4.8.0.0) under Numeric.Natural
. If you are open to the idea I can submit a pull request. Thank you for your consideration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.