{- |
    Module      :  $Header$
    Description :  A lexer for Curry
    Copyright   :  (c) 1999 - 2004 Wolfgang Lux
                       2005        Martin Engelke
                       2011 - 2013 Björn Peemöller
                       2016        Finn Teegen
                       2016        Jan Tikovsky
    License     :  BSD-3-clause

    Maintainer  :  bjp@informatik.uni-kiel.de
    Stability   :  experimental
    Portability :  portable
-}
module Curry.Syntax.Lexer
  ( -- * Data types for tokens
    Token (..), Category (..), Attributes (..)

    -- * lexing functions
  , lexSource, lexer, fullLexer
  ) where

import Prelude hiding (fail)
import Data.Char
  ( chr, ord, isAlpha, isAlphaNum, isDigit, isHexDigit, isOctDigit
  , isSpace, isUpper, toLower
  )
import Data.List (intercalate)
import qualified Data.Map as Map
  (Map, union, lookup, findWithDefault, fromList)

import Curry.Base.LexComb
import Curry.Base.Position
import Curry.Base.Span

-- ---------------------------------------------------------------------------
-- Tokens. Note that the equality and ordering instances of Token disregard
-- the attributes, as so that the parser decides about accepting a token
-- just by its category.
-- ---------------------------------------------------------------------------

-- |Data type for curry lexer tokens
data Token = Token Category Attributes

instance Eq Token where
  Token c1 _ == Token c2 _ = c1 == c2

instance Ord Token where
  Token c1 _ `compare` Token c2 _ = c1 `compare` c2

instance Symbol Token where
  isEOF (Token c _) = c == EOF

  dist _ (Token VSemicolon         _) = (0,  0)
  dist _ (Token VRightBrace        _) = (0,  0)
  dist _ (Token EOF                _) = (0,  0)
  dist _ (Token DotDot             _) = (0,  1)
  dist _ (Token DoubleColon        _) = (0,  1)
  dist _ (Token LeftArrow          _) = (0,  1)
  dist _ (Token RightArrow         _) = (0,  1)
  dist _ (Token DoubleArrow        _) = (0,  1)
  dist _ (Token KW_do              _) = (0,  1)
  dist _ (Token KW_if              _) = (0,  1)
  dist _ (Token KW_in              _) = (0,  1)
  dist _ (Token KW_of              _) = (0,  1)
  dist _ (Token Id_as              _) = (0,  1)
  dist _ (Token KW_let             _) = (0,  2)
  dist _ (Token PragmaEnd          _) = (0,  2)
  dist _ (Token KW_case            _) = (0,  3)
  dist _ (Token KW_class           _) = (0,  4)
  dist _ (Token KW_data            _) = (0,  3)
  dist _ (Token KW_default         _) = (0,  6)
  dist _ (Token KW_deriving        _) = (0,  7)
  dist _ (Token KW_else            _) = (0,  3)
  dist _ (Token KW_free            _) = (0,  3)
  dist _ (Token KW_then            _) = (0,  3)
  dist _ (Token KW_type            _) = (0,  3)
  dist _ (Token KW_fcase           _) = (0,  4)
  dist _ (Token KW_infix           _) = (0,  4)
  dist _ (Token KW_instance        _) = (0,  7)
  dist _ (Token KW_where           _) = (0,  4)
  dist _ (Token Id_ccall           _) = (0,  4)
  dist _ (Token KW_import          _) = (0,  5)
  dist _ (Token KW_infixl          _) = (0,  5)
  dist _ (Token KW_infixr          _) = (0,  5)
  dist _ (Token KW_module          _) = (0,  5)
  dist _ (Token Id_forall          _) = (0,  5)
  dist _ (Token Id_hiding          _) = (0,  5)
  dist _ (Token KW_newtype         _) = (0,  6)
  dist _ (Token KW_external        _) = (0,  7)
  dist _ (Token Id_interface       _) = (0,  8)
  dist _ (Token Id_primitive       _) = (0,  8)
  dist _ (Token Id_qualified       _) = (0,  8)
  dist _ (Token PragmaHiding       _) = (0,  9)
  dist _ (Token PragmaLanguage     _) = (0, 11)
  dist _ (Token Id                 a) = distAttr False a
  dist _ (Token QId                a) = distAttr False a
  dist _ (Token Sym                a) = distAttr False a
  dist _ (Token QSym               a) = distAttr False a
  dist _ (Token IntTok             a) = distAttr False a
  dist _ (Token FloatTok           a) = distAttr False a
  dist _ (Token CharTok            a) = distAttr False a
  dist c (Token StringTok          a) = updColDist c (distAttr False a)
  dist _ (Token LineComment        a) = distAttr True  a
  dist c (Token NestedComment      a) = updColDist c (distAttr True  a)
  dist _ (Token PragmaOptions      a) = let (ld, cd) = distAttr False a
                                        in  (ld, cd + 11)
  dist _ _                            = (0, 0)

-- TODO: Comment
updColDist :: Int -> Distance -> Distance
updColDist c (ld, cd) = (ld, if ld == 0 then cd else cd - c + 1)

distAttr :: Bool -> Attributes -> Distance
distAttr isComment attr = case attr of
  NoAttributes              -> (0, 0)
  CharAttributes     _ orig -> (0, length orig + 1)
  IntAttributes      _ orig -> (0, length orig - 1)
  FloatAttributes    _ orig -> (0, length orig - 1)
  StringAttributes   _ orig
      -- comment without surrounding quotes
    | isComment             -> (ld, cd)
      -- string with one ending double quote or two surrounding double quotes
      -- (column distance + 1 / + 2)
    | '\n' `elem` orig      -> (ld, cd + 1)
    | otherwise             -> (ld, cd + 2)
    where ld = length (filter    (== '\n') orig)
          cd = length (takeWhile (/= '\n') (reverse orig)) - 1
  IdentAttributes    mid i  -> (0, length (intercalate "." (mid ++ [i])) - 1)
  OptionsAttributes mt args -> case mt of
                                 Nothing -> (0, distArgs + 1)
                                 Just t  -> (0, length t + distArgs + 2)
    where distArgs = length args

-- |Category of curry tokens
data Category
  -- literals
  = CharTok
  | IntTok
  | FloatTok
  | StringTok

  -- identifiers
  | Id   -- identifier
  | QId  -- qualified identifier
  | Sym  -- symbol
  | QSym -- qualified symbol

  -- punctuation symbols
  | LeftParen     -- (
  | RightParen    -- )
  | Semicolon     -- ;
  | LeftBrace     -- {
  | RightBrace    -- }
  | LeftBracket   -- [
  | RightBracket  -- ]
  | Comma         -- ,
  | Underscore    -- _
  | Backquote     -- `

  -- layout
  | VSemicolon         -- virtual ;
  | VRightBrace        -- virtual }

  -- reserved keywords
  | KW_case
  | KW_class
  | KW_data
  | KW_default
  | KW_deriving
  | KW_do
  | KW_else
  | KW_external
  | KW_fcase
  | KW_free
  | KW_if
  | KW_import
  | KW_in
  | KW_infix
  | KW_infixl
  | KW_infixr
  | KW_instance
  | KW_let
  | KW_module
  | KW_newtype
  | KW_of
  | KW_then
  | KW_type
  | KW_where

  -- reserved operators
  | At           -- @
  | Colon        -- :
  | DotDot       -- ..
  | DoubleColon  -- ::
  | Equals       -- =
  | Backslash    -- \
  | Bar          -- |
  | LeftArrow    -- <-
  | RightArrow   -- ->
  | Tilde        -- ~
  | DoubleArrow  -- =>

  -- special identifiers
  | Id_as
  | Id_ccall
  | Id_forall
  | Id_hiding
  | Id_interface
  | Id_primitive
  | Id_qualified

  -- special operators
  | SymDot      -- .
  | SymMinus    -- -

  -- special symbols
  | SymStar -- kind star (*)

  -- pragmas
  | PragmaLanguage -- {-# LANGUAGE
  | PragmaOptions  -- {-# OPTIONS
  | PragmaHiding   -- {-# HIDING
  | PragmaMethod   -- {-# METHOD
  | PragmaModule   -- {-# MODULE
  | PragmaEnd      -- #-}


  -- comments (only for full lexer) inserted by men & bbr
  | LineComment
  | NestedComment

  -- end-of-file token
  | EOF
    deriving (Eq, Ord)

-- There are different kinds of attributes associated with the tokens.
-- Most attributes simply save the string corresponding to the token.
-- However, for qualified identifiers, we also record the list of module
-- qualifiers. The values corresponding to a literal token are properly
-- converted already. To simplify the creation and extraction of
-- attribute values, we make use of records.

-- |Attributes associated to a token
data Attributes
  = NoAttributes
  | CharAttributes    { cval     :: Char        , original :: String }
  | IntAttributes     { ival     :: Integer     , original :: String }
  | FloatAttributes   { fval     :: Double      , original :: String }
  | StringAttributes  { sval     :: String      , original :: String }
  | IdentAttributes   { modulVal :: [String]    , sval     :: String }
  | OptionsAttributes { toolVal  :: Maybe String, toolArgs :: String }

instance Show Attributes where
  showsPrec _ NoAttributes             = showChar '_'
  showsPrec _ (CharAttributes    cv _) = shows cv
  showsPrec _ (IntAttributes     iv _) = shows iv
  showsPrec _ (FloatAttributes   fv _) = shows fv
  showsPrec _ (StringAttributes  sv _) = shows sv
  showsPrec _ (IdentAttributes  mid i) = showsEscaped
                                       $ intercalate "." $ mid ++ [i]
  showsPrec _ (OptionsAttributes mt s) = showsTool mt
                                       . showChar ' ' . showString s
    where showsTool = maybe id (\t -> showChar '_' . showString t)


-- ---------------------------------------------------------------------------
-- The 'Show' instance of 'Token' is designed to display all tokens in their
-- source representation.
-- ---------------------------------------------------------------------------

showsEscaped :: String -> ShowS
showsEscaped s = showChar '`' . showString s . showChar '\''

showsIdent :: Attributes -> ShowS
showsIdent a = showString "identifier " . shows a

showsSpecialIdent :: String -> ShowS
showsSpecialIdent s = showString "identifier " . showsEscaped s

showsOperator :: Attributes -> ShowS
showsOperator a = showString "operator " . shows a

showsSpecialOperator :: String -> ShowS
showsSpecialOperator s = showString "operator " . showsEscaped s

instance Show Token where
  showsPrec _ (Token Id                 a) = showsIdent a
  showsPrec _ (Token QId                a) = showString "qualified "
                                           . showsIdent a
  showsPrec _ (Token Sym                a) = showsOperator a
  showsPrec _ (Token QSym               a) = showString "qualified "
                                           . showsOperator a
  showsPrec _ (Token IntTok             a) = showString "integer "   . shows a
  showsPrec _ (Token FloatTok           a) = showString "float "     . shows a
  showsPrec _ (Token CharTok            a) = showString "character " . shows a
  showsPrec _ (Token StringTok          a) = showString "string "    . shows a
  showsPrec _ (Token LeftParen          _) = showsEscaped "("
  showsPrec _ (Token RightParen         _) = showsEscaped ")"
  showsPrec _ (Token Semicolon          _) = showsEscaped ";"
  showsPrec _ (Token LeftBrace          _) = showsEscaped "{"
  showsPrec _ (Token RightBrace         _) = showsEscaped "}"
  showsPrec _ (Token LeftBracket        _) = showsEscaped "["
  showsPrec _ (Token RightBracket       _) = showsEscaped "]"
  showsPrec _ (Token Comma              _) = showsEscaped ","
  showsPrec _ (Token Underscore         _) = showsEscaped "_"
  showsPrec _ (Token Backquote          _) = showsEscaped "`"
  showsPrec _ (Token VSemicolon         _)
    = showsEscaped ";" . showString " (inserted due to layout)"
  showsPrec _ (Token VRightBrace        _)
    = showsEscaped "}" . showString " (inserted due to layout)"
  showsPrec _ (Token At                 _) = showsEscaped "@"
  showsPrec _ (Token Colon              _) = showsEscaped ":"
  showsPrec _ (Token DotDot             _) = showsEscaped ".."
  showsPrec _ (Token DoubleArrow        _) = showsEscaped "=>"
  showsPrec _ (Token DoubleColon        _) = showsEscaped "::"
  showsPrec _ (Token Equals             _) = showsEscaped "="
  showsPrec _ (Token Backslash          _) = showsEscaped "\\"
  showsPrec _ (Token Bar                _) = showsEscaped "|"
  showsPrec _ (Token LeftArrow          _) = showsEscaped "<-"
  showsPrec _ (Token RightArrow         _) = showsEscaped "->"
  showsPrec _ (Token Tilde              _) = showsEscaped "~"
  showsPrec _ (Token SymDot             _) = showsSpecialOperator "."
  showsPrec _ (Token SymMinus           _) = showsSpecialOperator "-"
  showsPrec _ (Token SymStar            _) = showsEscaped "*"
  showsPrec _ (Token KW_case            _) = showsEscaped "case"
  showsPrec _ (Token KW_class           _) = showsEscaped "class"
  showsPrec _ (Token KW_data            _) = showsEscaped "data"
  showsPrec _ (Token KW_default         _) = showsEscaped "default"
  showsPrec _ (Token KW_deriving        _) = showsEscaped "deriving"
  showsPrec _ (Token KW_do              _) = showsEscaped "do"
  showsPrec _ (Token KW_else            _) = showsEscaped "else"
  showsPrec _ (Token KW_external        _) = showsEscaped "external"
  showsPrec _ (Token KW_fcase           _) = showsEscaped "fcase"
  showsPrec _ (Token KW_free            _) = showsEscaped "free"
  showsPrec _ (Token KW_if              _) = showsEscaped "if"
  showsPrec _ (Token KW_import          _) = showsEscaped "import"
  showsPrec _ (Token KW_in              _) = showsEscaped "in"
  showsPrec _ (Token KW_infix           _) = showsEscaped "infix"
  showsPrec _ (Token KW_infixl          _) = showsEscaped "infixl"
  showsPrec _ (Token KW_infixr          _) = showsEscaped "infixr"
  showsPrec _ (Token KW_instance        _) = showsEscaped "instance"
  showsPrec _ (Token KW_let             _) = showsEscaped "let"
  showsPrec _ (Token KW_module          _) = showsEscaped "module"
  showsPrec _ (Token KW_newtype         _) = showsEscaped "newtype"
  showsPrec _ (Token KW_of              _) = showsEscaped "of"
  showsPrec _ (Token KW_then            _) = showsEscaped "then"
  showsPrec _ (Token KW_type            _) = showsEscaped "type"
  showsPrec _ (Token KW_where           _) = showsEscaped "where"
  showsPrec _ (Token Id_as              _) = showsSpecialIdent "as"
  showsPrec _ (Token Id_ccall           _) = showsSpecialIdent "ccall"
  showsPrec _ (Token Id_forall          _) = showsSpecialIdent "forall"
  showsPrec _ (Token Id_hiding          _) = showsSpecialIdent "hiding"
  showsPrec _ (Token Id_interface       _) = showsSpecialIdent "interface"
  showsPrec _ (Token Id_primitive       _) = showsSpecialIdent "primitive"
  showsPrec _ (Token Id_qualified       _) = showsSpecialIdent "qualified"
  showsPrec _ (Token PragmaLanguage     _) = showString "{-# LANGUAGE"
  showsPrec _ (Token PragmaOptions      a) = showString "{-# OPTIONS"
                                           . shows a
  showsPrec _ (Token PragmaHiding       _) = showString "{-# HIDING"
  showsPrec _ (Token PragmaMethod       _) = showString "{-# METHOD"
  showsPrec _ (Token PragmaModule       _) = showString "{-# MODULE"
  showsPrec _ (Token PragmaEnd          _) = showString "#-}"
  showsPrec _ (Token LineComment        a) = shows a
  showsPrec _ (Token NestedComment      a) = shows a
  showsPrec _ (Token EOF                _) = showString "<end-of-file>"

-- ---------------------------------------------------------------------------
-- The following functions can be used to construct tokens with
-- specific attributes.span>
<>)  showString

-- -------------------------------------------------l-6989586621679102600">a
  showsPrec _ ((showString

-- ------------)1-----------------------------------l-698958--------------------------------
(  = NoAttributes
= showString "string "    . PragmaMethoddentifier">cvalname="line-358">  showsPrec _ (Token= showString "string "    . +xer.htmlnInfo

-- |Retrieve the hierarchical name of a module
moduleName +xer.htmlnInfo

Token . +xer.htmlnInfo

(
Token . --   Furthermore, all rules of the original definition must be
PragmaModule        . --   Furthermore, all rules of tpan> "{-# MODULE"
  show6">  = --   Furthermoreer hs-var">PragmaModule        . --   Furthermore, all rules of tpan> &aModule        . 2_ (Token --   Furthermoreer 0s-var">PragmaModulease &aModule       <Token 2= where
  shspan>_ --   Furthermoree/span>

showsOperator :: s shspan>_ 4span clas-comment">--   Furthermoree/span>

isComment             ) = shows cv
  showString showsOperator :: s shspan>_r.html#OptionsAttributes">OptionsAspan class="hs-special">(shows e2
ppExpr-6989586621679081987">c : show nCurry.FlatCurry.Annotated.Goodies, = e
OptionsAttributes n class="hs-identifier special">)
  shows nCurry.FlatCurry.Annotated.Goodies, =   Token Cha> <$>-> \Token Comma              Token Comma              Token _ (yntax.Lexer.html#KWn class="hs-operator hs-var"><$>Token Comma              c (Token __ (Token --   Furthermoreer 0s-var">Praal">original ::  where
  shspan>_Semicolon     -- ;
Comb >original :: showsEscaped "external"
  showsEscaped "external"
  <$&"line-351">(Token where
  showsPrec _ = showsEscaped "_"
  shovowan>  shovowan>  shovowan>  var">Comma              Token StringAttributes :: <{ href="Curry.Fln>
  | QSym --s="hs-identifier">shovowan>  shovowan> "hs-identifier">cas _LeftBrace     -- {
  | = QSym --s="hs-identifier">shovowarean> (.)<,ovowan> -an class="hs-identifier">VSemicolon         -- virtual ;
-- ::
  showsEscaped "if"
  showsPrec _ classhowsEscahs-glyps-identifier hs-var">showsEscths-glyps-identifier hs-var">showsEsclass="hs-identifier hs-type">String }
  |  1= case  _ classhowsEscahs-glyps-identifier hs-var">showsEsn>                                 Nothing -> OneLineModeCurry.Base.PrettyaQSym               a) span>        orig<(8>0)SymMonus    -- -

<                       "no copan>">), cd entifier,2 --]virtual ;
-- ::distArgs = length Token where
  _ (Token . shows (..)
                            ,  ((Token -- -
 shows , length (intercalate "." mid ++ = (0/span>-- =
  | Backslash     = maybe id (\ :: (tcs"hs-identifier hs-var">id ( isComment showsEscap-283">  -- |a call to a function where /span>shovowan>  _) args
 KW_if              _) = Category
  -- literals
  showsEscaped s

-- .
  (Token<-137">  -- literals
StringTok  -- literals
span>s showString "string "showsEscaped "instance"
  showsPrec -- literals
span>original :: showsEscaped | Token<-137">
shovowan>  Token   | QSym -- qualified symbol
) =  1hs-special">(Token 1)
  IntAttributes      _Token<33h">| DoubleColon  -- ::
  |yph">->
al">)   -- | Compute the arity of a tuple identifier
  -- symbol
  | = ld = length (Doubl/a>  | -- symbol
  | KW_data
  | Str">KW_default
  | "newtype"
    | "in"
  | -- However, for qualified identifiers, we also record the list of module-- pragmas
-- converted already. To 1008an>(Token showsEscaped Token -- However, for qualified identifiers, we also record the list of module'\n'e, f='\n'e,  namea> = length f=Token showsEscaped 

) = -- #-}

(f=Token  = -- #-}

showsOperator a = showString "operator "  |=~= (y  |=~= (_ length ( Extension CRhs (..),   |..)
  a) = showStringlass="hs-special">) -> al">)   -- | Compute thrspan> isDataTypeDecl, 
showsOperator Curry.Syntax.Utils, Curry.SyntaxITypeDecl
showsOperator Curry.Syntax.Utils, Curry.Syntaxn>showsPrectail $ lines $ showToken ITypeDecl
-- ---------------------------------------------------">"free"
  shows="hs-identifier hs-var">showToken ITypeDecl
--   m eval choice

progLines 
cs-- ]


QSym fr = f=Id_/span>=  = showsSpecialIdent "ccall"
  f=Id_forall         #‚/span>_) = ->    -- ->
  | Tilde         class="hs-keyword">import Curry.FlatCurry.Goodies (pan>05yph">= -- =>

  -- special id>KW_default <-2dentifier">_ (Curry.Base.Message2 (Data Constructor)KW_else
Curry.Base.Messageh"a>methssag-- =>

  -- special id>KW_default <-2dentifier">_<         class="hs-keyword">import &aModule       <Tokenar">pan> (Token -> Tokenar">pan> (Token _ (Token           classyntax.Lexer.html#Pragm/sp_ Tokenar">pan> (, Curry.SyntaxExport 1 (Type/Class)| PragmaModule   -- {-# MODULE
  | , Curry.SyntaxExport 1 (Type/Class)| = ) ((_  "externrl"
, Curry.SyntaxExcrurry.FlatC/span>&aMi"ule       <Export Token | = ) ((_ , Curry.SyntaxExcrurry.FlatC/span>&aMi"ule       <= ) ((_   0/span><-137">  -- literals
) (n) --   Furthermoreer 0s-var">PragmaModulease &aModule       <)Tilde         class="hs-keyword">import Curry.FlatCurry.Goodies (pan>05yph">= 
) (na name="line-239">-- However, for qualified identifiers, we e="line-275">showsIdent :: 2/span>showsEscaped "newtype"
  n(ph">::span> na name="line-239">-- However, for qualified identifiers, we e="line-275">showsIdent   0/span><-137">  -- literals
) (n<(a>) --   Furthermoreer 0s-var">PragmaModulease &aModule       <)Ti/a>              c   -- literals
) () --   Furthermoreer 0s-var">PragmaModulease &aModule    rals
) (string">&aModule       <)Ti/a>              >, Pretty )   | DoubleArrow  -- =>
--   Furthermoreer 0s-var"ame="line-204">    
)     "newtype"
-- literals
) DoubleArrow  -- =>
--   Furthermor"0;newtype"
-- er 0s-var"ame="line-204">  showsTool  _shovowan>  shovowan>   Comma              Token _DoubleArrow  -- =>
--   Furthermor"0;newtype"
KW_where           _) =   _        -- :
  | showsSpecialIdent "ccall"
  showsPrecshowsPrecshowsPrecshowsPrecshowsPrecshowsPrecshowsPshowsPrecshowsPrecshowsPrecshowsPrecshowsPrec  | QSym --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> --s="hs> :span cl"ss="hs-commrnt">--s="hs> :span cl"ss="hs-commrnt">--s="hs> :span cl"ssntax. _ classhowsEscahs-glyps-identifier hsa>   -- literals
ryntax.Lexer.html#QSym">Token 
  
--s="hs> --s="hs>.Pretty.html#Pretty">Pretty )  ;"hs-i"Curry.Syntlyph">| DoubleArrow<"hs-identifier">DoubleArrow<"hs-identifier">DoubleArrow<"hs-identifier">DoubleArrow<"hs-identifier">DoubleArrow<"hs-identifier">DoubleArrow<"hs-ident-identifier
--s="hs> --s="hs>.Pretty.html#Prepan class="hs-comment"05">Token . --   Furthermore, all rules of the original definition must be
}
Token; TExpr
}
QSym --s="hs> --s="hs>     --s="hs> 1= qn 
--s="hs> --s="hs>.Pretty.html#Pretty">Pretty )_ IntAttributes      _Token<33h">| var">Comma              Tokentml#PragmaModule">PragmaModule       }
"Curry.Flatpan> =.<">Token 
)distArgs = length }
"Curry.Flatpan> =.<">Token   }
"Curry.Flatpan> =.<">Token --s="hs> :span cl"ssntax. |  | .<">Token  shovowan>  shovowan>  shovowan>  ) = showsSpecialIdent "primitive"
ing "{-# OPTIONS"
                                           . shows   shovowan>  shovowan>  ) =< hs-var">. shows   shovowan>  . shows. shows fix . shof=)pan>) . shows ft ff Token   }
"Curry.Flatpan> }
"Curry.Flatpan> }
"Curry.Flatpan> }
"Curry.Flatpan> }ft shof=)pan>) . shows DoubleArrow<"hs-ident-identifier
}  }
"Curry.Flatpan> }
"Curry.Flatpan> shof=)pan>) . }
"Curry.Flatpan> }
"Curry.Flatpan> shof=)pan>) . } shof=)pan>) . }
"""""""""""""""""n>DoubleArrow<"hs-ident-identifier>>>>>>>>>>>>>>>>>>>>>>>>an>
-- converted already. To 1008pan>-- converted already. To 1008pan>-- converted already. To 1008pan>Expr
updFrees<(02. }
"""""""""""""""""n>DoubleArrow<"hs-ident-identifierDoubl/Lexer.html#Attributes">Attributes  -- symbol
  Expr
Bool
<21679093436">shof=)pan>)fa ) -- converted already. To 1008pan>-->(

-- ---------------------------------------------------------------------------
updFrees<(02. }
"""""""""""""""""n>DoubleArrow<"hs-ident-identifierColon              _updFrees
updFrees2(02.8+pnn>n>     -- {
  | = =QSym --s="hfeidentifier">shovowarean>  (.-- {
  | = -->(

) span>        orig<(8>0)(.-- {
  | . --   Furthermore, all rules of tpan> "{-# MODULE"
  show6">   --   Furthermore, all rules of tpan> "{-# MODULE"
  show6">   
  mt
<@panan> "{-# MODULE"
  show6">  "{-# MODULE"
. 
  mt
<@panan>  <621679102599">a)orig<(8>0)
  |=~= s mid ++ = (0/span>--var">Token  Backslash 
  mt
80 name="line-263"><@panan> 
-- |Specified language extensions, either known or unknoer hs-var">s  a)<  | = _ (a)orig<(8>0)
s | = ) (FlatCurry-Type.html#v:Prog" title="Curry.FlatCurry.Type">Curry.FlatCurry.Typ>
80 name="line-263"><@panan> 
s | = = case Curry.FlatCurry.Typ>
80 name="line-glyph">|yph">->Show (  <621679102599">a)<  | =    showsPrec _:Show" title="Text.Show">Show ( $ lines $ showToken  <621679102599">a)<  | =  hsspan class="hs-identifier hs-var">id Show ( <"hs-identifier">a)<  | =  a=  )<  | id f id id
.s

= f id id
.s

 <"hs-identifier">aShow ( )<  |id id
.s
((  shows="hs-identifier hs-var">showToken id
.s

 <"hs-identifier">aShow (id id
.s  | =  a= .s
<"hs-identifier">aShow (id   | =
.s   showString ,