[Haskell-cafe] Re: Emacs Haskell Mode: Indenting after "where"

Joel Reymont joelr1 at gmail.com
Fri Oct 7 04:30:04 EDT 2005


The following in haskell-indent.el does the trick.
Note the "where" added after "type".

(defconst haskell-indent-start-keywords-re
   (concat "\\<\\("
       "class\\|data\\|i\\(mport\\|n\\(fix\\(\\|[lr]\\)\\|stance\\)\\) 
\\|"
       "module\\|newtype\\|primitive\\|type\\|where"
       "\\)\\>")
   "Regexp describing keywords to complete when standing at the first  
word
of a line.")

On Oct 6, 2005, at 10:40 PM, Joel Reymont wrote:

> Folks,
>
> Does anyone know how to make the Haskell mode (Emacs) indent the  
> line after "where" for this type of look:
>
>     peek = if be then peek0 else peekR
>         where
>            peek0 a = fmap BigEndian $ peek (castAway a)
>            peekR a = peekByteOff a 0
>
> instead of this:
>
>     peek = if be then peek0 else peekR
>         where
>         peek0 a = fmap BigEndian $ peek (castAway a)
>         peekR a = peekByteOff a 0

--
http://wagerlabs.com/idealab







More information about the Haskell-Cafe mailing list