[GHC] #12833: GHCi
GHC
ghc-devs at haskell.org
Sun Nov 13 04:34:25 UTC 2016
#12833: GHCi
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: feature | Status: new
request |
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
In multiline mode you can define a multi-line Haskell function:
{{{
Prelude> :set +m
Prelude> let
Prelude| f :: Int -> Int
Prelude| f 0 = 0
Prelude| f n = n - 1
Prelude|
Prelude>
}}}
Is there a reason why it couldn't work with other things like
{{{
Prelude> :set -XPatternSynonyms
Prelude> let
Prelude| pattern A = 'A'
Prelude|
<interactive>:27:1: error:
Illegal pattern synonym declaration for ‘A’
Pattern synonym declarations are only valid at top level
}}}
{{{
Prelude> let
Prelude| data A
Prelude| = B
Prelude| | C Int
Prelude|
<interactive>:30:1: error:
parse error (possibly incorrect indentation or mismatched brackets)
}}}
{{{
Prelude> let
Prelude| type A = Int
Prelude|
<interactive>:48:1: error:
parse error (possibly incorrect indentation or mismatched brackets)
}}}
couldn't work, similar to how they work with `:{` and `:}`:
{{{
Prelude> :{
Prelude| data A
Prelude| = B
Prelude| | C Int
Prelude| :}
Prelude>
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12833>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list