TypeOperators and Unicode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

TypeOperators and Unicode

Grigory Sarnitskiy
I want to have Unicode symbols for type operator:

{-# LANGUAGE TypeOperators #-}

data a ── b = Foo a b

But it doesn't work. Any suggestions?

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: TypeOperators and Unicode

Maciej Piechotka
On Mon, 2011-09-12 at 11:51 +0400, Grigory Sarnitskiy wrote:
> I want to have Unicode symbols for type operator:
>
> {-# LANGUAGE TypeOperators #-}

Add also:

{-# LANGUAGE UnicodeSyntax #-}

>
> data a ── b = Foo a b
>
> But it doesn't work. Any suggestions?

Regards

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: TypeOperators and Unicode

Grigory Sarnitskiy
Still

{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UnicodeSyntax #-}

data a ── b = Foo a b

leads to

test.hs:4:6: Malformed head of type or class declaration: a ── b
Failed, modules loaded: none.

12.09.2011, 11:56, "Maciej Marcin Piechotka" <[hidden email]>:

> On Mon, 2011-09-12 at 11:51 +0400, Grigory Sarnitskiy wrote:
>
>>  I want to have Unicode symbols for type operator:
>>
>>  {-# LANGUAGE TypeOperators #-}
>
> Add also:
>
> {-# LANGUAGE UnicodeSyntax #-}
>
>>  data a ── b = Foo a b
>>
>>  But it doesn't work. Any suggestions?
>
> Regards
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: TypeOperators and Unicode

Brandon Allbery
2011/9/12 Grigory Sarnitskiy <[hidden email]>
Still

{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UnicodeSyntax #-}

data a ── b = Foo a b

leads to

test.hs:4:6: Malformed head of type or class declaration: a ── b
Failed, modules loaded: none.

Don't all infix constructors have to start with a colon?

--
brandon s allbery                                      [hidden email]
wandering unix systems administrator (available)     (412) 475-9364 vm/sms


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: TypeOperators and Unicode

Roel van Dijk-3
2011/9/12 Brandon Allbery <[hidden email]>:
> Don't all infix constructors have to start with a colon?

Yes that is true. You can of course use Unicode symbols as infix type variables:

(⋙) :: Category ⇝ => (α ⇝ β) -> (β ⇝ γ) -> α ⇝ γ

But a constructor must always begin with a capital letter or with a colon.

UnicodeSyntax is only required if you want to replace existing Haskell
syntax with Unicode.

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe