On Wed, 6 Jan 2010, Gwern Branwen wrote:
On Wed, Jan 6, 2010 at 7:23 PM, Tony Morris wrote:
ghc -e "import Control.Monad; forM [[1,2,3]] reverse"
As of 6.10.2, the bug whereby the GHC API lets you use functions from
anywhere just by naming them (Java-style) has not been fixed:
$ ghc -e "Co
On Wed, Jan 6, 2010 at 6:15 PM, Reid Barton wrote:
> On Thu, Jan 07, 2010 at 10:23:35AM +1000, Tony Morris wrote:
> > Can I import a module when using ghc -e?
> >
> > e.g. ghc -e "import Control.Monad; forM [[1,2,3]] reverse"
>
> One option is to create a file "imports.hs" which contains the text
On Wed, Jan 6, 2010 at 7:35 PM, Tony Morris wrote:
> Gwern Branwen wrote:
>> On Wed, Jan 6, 2010 at 7:23 PM, Tony Morris wrote:
>>
>>> ghc -e "import Control.Monad; forM [[1,2,3]] reverse"
>>>
>>
>> As of 6.10.2, the bug whereby the GHC API lets you use functions from
>> anywhere just by naming t
On Thu, Jan 07, 2010 at 10:23:35AM +1000, Tony Morris wrote:
> Can I import a module when using ghc -e?
>
> e.g. ghc -e "import Control.Monad; forM [[1,2,3]] reverse"
One option is to create a file "imports.hs" which contains the text
"import Control.Monad", and then run
ghc -e "forM [[1,2,3]] r
Gwern Branwen wrote:
> On Wed, Jan 6, 2010 at 7:23 PM, Tony Morris wrote:
>
>> ghc -e "import Control.Monad; forM [[1,2,3]] reverse"
>>
>
> As of 6.10.2, the bug whereby the GHC API lets you use functions from
> anywhere just by naming them (Java-style) has not been fixed:
>
> $ ghc -e "Co
On Wed, Jan 6, 2010 at 7:23 PM, Tony Morris wrote:
> ghc -e "import Control.Monad; forM [[1,2,3]] reverse"
As of 6.10.2, the bug whereby the GHC API lets you use functions from
anywhere just by naming them (Java-style) has not been fixed:
$ ghc -e "Control.Monad.forM [[1,2,3]] reverse"
package f
Can I import a module when using ghc -e?
e.g. ghc -e "import Control.Monad; forM [[1,2,3]] reverse"
--
Tony Morris
http://tmorris.net/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
interact :: (String -> String) -> IO () is a very handy function for
ghc -e, e.g.
ghc -e 'interact $ lines . map (show . (*2) . read) . unlines'
will multiply the number on every line by 2. (interact takes a
function which maps from entire input to entire output)
On 05/11/2007, Graham Fawcett <[
On Nov 5, 2007 2:41 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote:
> On Nov 5, 2007 1:46 PM, Maurício <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Is there a way to run 'ghc -e' taking input
> > from standard input? I would like to use it
> > in a pipe.
>
> It seems to me that you can use getContent
On Nov 5, 2007 1:46 PM, Maurício <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a way to run 'ghc -e' taking input
> from standard input? I would like to use it
> in a pipe.
It seems to me that you can use getContents, et. al., as you would
from any other Haskell program:
$ echo hello there mauri
On Nov 5, 2007 1:46 PM, Maurício <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a way to run 'ghc -e' taking input
> from standard input? I would like to use it
> in a pipe.
>
xargs ought to do the trick nicely.
-Brent
___
Haskell-Cafe mailing list
Has
Hi,
Is there a way to run 'ghc -e' taking input
from standard input? I would like to use it
in a pipe.
Thanks,
Maurício
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
12 matches
Mail list logo