hasktags - small patch

Marc Weber marco-oweber at gmx.de
Fri Feb 16 23:12:13 EST 2007


While starting to learn more about webfunctions I have noticed that
hasktags doesn't recognize rwUserName and rwPasswd in the following code:

data LogInController =
  LogInController {rLoggedIn::R Bool, rwUserName::RWE String, rwPasswd::RWE String}

When using spaces it does
  LogInController {rLoggedIn :: R Bool, rwUserName :: RWE String, rwPasswd :: RWE String}

This small patch introduces a now mywords function which recognizes a::b as words a,::,b
which is what we need here (?) It does work in the above example.

Here is the diff. Is it worth applying?

154c154
<       let wordlines = map words aslines
---
>       let wordlines = map mywords aslines
161a162,174
>       -- my words is mainly copied from Data.List.
>       -- difference abc::def is split into three words instead of one.
>       mywords :: String -> [String]
>       mywords (':':':':xs) = "::" : mywords xs
>       mywords s       =  case dropWhile {-partain:Char.-}isSpace s of
>                               "" -> []
>                               s' -> w : mywords s''
>                                     where (w, s'') = myBreak s'
>                                           myBreak [] = ([],[])
>                                           myBreak (':':':':xs) = ([], "::"++xs)
>                                           myBreak (' ':xs) = ([],xs);
>                                           myBreak (x:xs) = let (a,b) = myBreak xs
>                                                            in  (x:a,b)

Marc Weber


More information about the Glasgow-haskell-users mailing list