
Hey all, I was trying to define some pattern synonyms in ghci recently, and that doesnt seem to work. Is that something slated to be fix in 7.10 or something?

File a Trac ticket! From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Carter Schonwald Sent: 18 December 2014 06:15 To: ghc-devs@haskell.org Subject: are patterns synonyms definable in GHCI? Hey all, I was trying to define some pattern synonyms in ghci recently, and that doesnt seem to work. Is that something slated to be fix in 7.10 or something?

On Thu, 18 Dec 2014, Carter Schonwald wrote:
Hey all,I was trying to define some pattern synonyms in ghci recently, and that doesnt seem to work. Is that something slated to be fix in 7.10 or something?
I thought GHCi accepts things that would be valid in a 'do' section? So e.g. x = () doesn't work in GHCi, but let x = () does. Pattern synonyms don't work for the exact same reason: they are not valid inside a 'do' block.

But GHCi does support data type declarations ghci> data T = A | B so presumably it ought also to support pattern synonym declarations. Simon | -----Original Message----- | From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Dr. | ERDI Gergo | Sent: 18 December 2014 10:52 | To: Carter Schonwald | Cc: ghc-devs@haskell.org | Subject: Re: are patterns synonyms definable in GHCI? | | On Thu, 18 Dec 2014, Carter Schonwald wrote: | | > Hey all,I was trying to define some pattern synonyms in ghci | recently, | > and that doesnt seem to work. Is that something slated to be fix in | 7.10 or something? | | I thought GHCi accepts things that would be valid in a 'do' section? | So e.g. | | x = () | | doesn't work in GHCi, but | | let x = () | | does. | | Pattern synonyms don't work for the exact same reason: they are not | valid inside a 'do' block. | _______________________________________________ | ghc-devs mailing list | ghc-devs@haskell.org | http://www.haskell.org/mailman/listinfo/ghc-devs

ghci also accepts a number of other things.
You can define data types, type synonyms, classes, instances, so pattern
synonyms would seem to fall into scope.
On Thu, Dec 18, 2014 at 5:51 AM, Dr. ERDI Gergo
On Thu, 18 Dec 2014, Carter Schonwald wrote:
Hey all,I was trying to define some pattern synonyms in ghci recently,
and that doesnt seem to work. Is that something slated to be fix in 7.10 or something?
I thought GHCi accepts things that would be valid in a 'do' section? So e.g.
x = ()
doesn't work in GHCi, but
let x = ()
does.
Pattern synonyms don't work for the exact same reason: they are not valid inside a 'do' block. _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

On Thu, 18 Dec 2014, Edward Kmett wrote:
ghci also accepts a number of other things. You can define data types, type synonyms, classes, instances, so pattern synonyms would seem to fall into scope.
Wow, I didn't know about this feature. In that case, yes, I agree, pattern synonyms should be supported in GHCi :)

On Thu, 18 Dec 2014, Dr. ERDI Gergo wrote:
Wow, I didn't know about this feature. In that case, yes, I agree, pattern synonyms should be supported in GHCi :)
Filed as #9900. -- .--= ULLA! =-----------------. \ http://gergo.erdi.hu \ `---= gergo@erdi.hu =-------' Egér: az elefánt japán változata

On 18/12/14 12:51, Dr. ERDI Gergo wrote:
On Thu, 18 Dec 2014, Carter Schonwald wrote:
Hey all,I was trying to define some pattern synonyms in ghci recently, and that doesnt seem to work. Is that something slated to be fix in 7.10 or something?
I thought GHCi accepts things that would be valid in a 'do' section? So e.g.
x = ()
doesn't work in GHCi, but
let x = ()
does.
Pattern synonyms don't work for the exact same reason: they are not valid inside a 'do' block.
That's not true. Since 7.6, IIRC, you can define data types and instances in ghci. See also https://ghc.haskell.org/trac/ghc/ticket/7253 Roman
participants (5)
-
Carter Schonwald
-
Dr. ERDI Gergo
-
Edward Kmett
-
Roman Cheplyaka
-
Simon Peyton Jones