Simple implicit parameters question

brk@jenkon.com brk@jenkon.com
Mon, 27 Aug 2001 18:37:03 -0700


Hi all,

Using one implicit parameter works fine for me, but when I use two, things
seem to go astray. Here's a highly contrived example:

main =
  do
    putStrLn $ mytrim with ?width = 20 with ?line = "The quick brown fox
jumped over the lazy dog"


mytrim | ?width > length ?line = ?line
       | otherwise             = take ?width ?line


But ghc complains:

$ ghc -o scratch.exe scratch.hs -fglasgow-exts

scratch.hs:8:
    Unbound implicit parameter `?width :: Int'
    arising from use of implicit parameter `?width' at scratch.hs:8
    In the first argument of `(>)', namely `?width'
    In the definition of `mytrim': ?width > (length ?line)

scratch.hs:8:
    Unbound implicit parameter `?line :: [Char]'
    arising from use of implicit parameter `?line' at scratch.hs:8
    In the first argument of `length', namely `?line'
    In the second argument of `(>)', namely `length ?line'


Can someone please tell me what I'm doing wrong?

Thanks,

Bryn Keller
Senior Software Engineer
Jenkon
brk@jenkon.com