multi-line blocks :{ ... :} may contain many definitions, but only one import?
Apparently, you can put several value/function declarations in a :{ .. :} group, but only one import declaration or statement (foo <- bar
).
The documentation https://downloads.haskell.org/ghc/latest/docs/users_guide/ghci.html#ghci-cmd-:{ does not make this quite clear (to me, at least)
We noticed this in the tidalcycles
project, where ghci
reads a script file for setting up convenient abbreviations that refer to information (about a server connection) that can only be obtained at run-time ( https://github.com/tidalcycles/Tidal/blob/main/BootTidal.hs https://club.tidalcycles.org/t/euclidian-sub-patterns-masking-beats-from-euclids/4533/11 )