Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  send string to stack ghc (Paum B.)
   2.  cabal.config (sandbox) with Chart package (Jack Vice)
   3. Re:  cabal.config (sandbox) with Chart package (Imants Cekusins)


----------------------------------------------------------------------

Message: 1
Date: Fri, 24 Aug 2018 14:51:38 +0200
From: "Paum B." <fraybauh...@gmail.com>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] send string to stack ghc
Message-ID:
        <CAOjfzX1NGk+jEH+=7wpw05ny2m7m6ey5laj0awaybjyp1oq...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

many thanks, I have found what I need -> http://empty.sourceforge.net/

paum

On Fri, Aug 24, 2018 at 2:37 PM Paul <aqua...@gmail.com> wrote:

> This are listing expect alternatives: https://en.wikipedia.org/wiki/Expect
> Btw, it's easy to be done in Python.
>
> Also my IMHO that better is to pass extension directives not in command
> line (it will be big) but in custom .ghci file with option "-ghci-script".
>
> 24.08.2018 15:27, David McBride wrote:
>
> You should be able to run something like this:
>
> echo 'putStrLn "hi"' | stack exec -- ghci -XOverloadedStrings
>
> On Fri, Aug 24, 2018 at 8:21 AM, Paum B. <fraybauh...@gmail.com> wrote:
>
>> Actually, I dont know if I have asked good question to what I need.
>> So, I would like to run the process:
>>
>> stack ghc -- --interactive -XOverloadedStrings
>>
>> and then, somehow from 'outside' push string commands to it...
>>
>> On Fri, Aug 24, 2018 at 2:08 PM Paum B. <fraybauh...@gmail.com> wrote:
>>
>>> oh, thats good - thank you!
>>>
>>> is there any example in bash?
>>>
>>> thnx
>>>
>>> On Fri, Aug 24, 2018 at 2:02 PM Paul <aqua...@gmail.com> wrote:
>>>
>>>> Sure. I remember old days Tcl/Tk utility "expect" for such interactive
>>>> scripting sessions. Open a pipes and communicate with process :) Today
>>>> there are tools similar to "expect" for scripting command line utilities.
>>>>
>>>> Also Emacs works with GHCi (interro) in such way. Also Dante IMHO.
>>>> Visual Studio Code Haskelly and Haskerro, etc..
>>>>
>>>>
>>>>
>>>> 24.08.2018 14:58, Paum B. wrote:
>>>>
>>>> Hi List,
>>>>
>>>> It is possibile to run:
>>>>
>>>> stack ghc -- --interactive -XOverloadedStrings
>>>>
>>>> and then send to it strings (commands) externally?
>>>> Thanks
>>>>
>>>> paum
>>>>
>>>>
>>>> _______________________________________________
>>>> Beginners mailing 
>>>> listBeginners@haskell.orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>>
>>>>
>>>> _______________________________________________
>>>> Beginners mailing list
>>>> Beginners@haskell.org
>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>>
>>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>
>
> _______________________________________________
> Beginners mailing 
> listBeginners@haskell.orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20180824/d98b0197/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 24 Aug 2018 15:22:41 -0400
From: Jack Vice <jack.v...@gmail.com>
To: beginners@haskell.org
Subject: [Haskell-beginners] cabal.config (sandbox) with Chart package
Message-ID:
        <calazo9etqckmd_8sgkryzwpg3olr5xe83e2vrzynldywxes...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I am attempting my first sandbox build with a cabal package (Chart) and I
don't know what to put in my cabal.config file after looking at these sites:
https://www.haskell.org/cabal/users-guide/developing-packages.html
http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html
https://wiki.haskell.org/Cabal-Install

I am getting the following build error:
*Building chartHask-0.1.0.0...*
*Preprocessing executable 'chartHask' for chartHask-0.1.0.0...*
*[1 of 1] Compiling Main             ( Main.hs,
dist/build/chartHask/chartHask-tmp/Main.o )*

*Main.hs:5:1: error:*
*    Failed to load interface for ‘Graphics.Rendering.Chart.Backend.Cairo’*
*    Perhaps you meant*
*      Graphics.Rendering.Chart.Backend.Impl (from Chart-1.9)*
*      Graphics.Rendering.Chart.Backend.Types (from Chart-1.9)*
*      Graphics.Rendering.Chart.Backend (from Chart-1.9)*
*    Use -v to see a list of the files searched for.*

So, Maybe I'm dumb or it's not explicit (or both) on how to add a package
to my cabal.config so it can find it and build.  I tried adding this to my
cabal.config to no avail:
*documentation: True*
*constraints: Chart >= 1.9*

Main.hs (from Chart example:
*module Main where*

*import Graphics.Rendering.Chart.Easy*
*import Graphics.Rendering.Chart.Backend.Cairo*

*signal :: [Double] -> [(Double,Double)]*
*signal xs = [ (x,(sin (x*3.14159/45) + 1) / 2 * (sin (x*3.14159/5))) | x
<- xs ]*

*main = toFile def "example1_big.png" $ do*
*    layout_title .= "Amplitude Modulation"*
*    setColors [opaque blue, opaque red]*
*    plot (line "am" [signal [0,(0.5)..400]])*
*    plot (points "am points" (signal [0,7..400]))*

Or should I be using Stack? (probably private email or new thread question)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20180824/fdc80879/attachment-0001.html>

------------------------------

Message: 3
Date: Fri, 24 Aug 2018 22:29:52 +0300
From: Imants Cekusins <ima...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] cabal.config (sandbox) with Chart
        package
Message-ID:
        <CAP1qinZG9Tk8D6B+L0Khx=ykxxsgghb0kfkentdw1a6gbsb...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi Jack,

cd to the root directory of your project and
> cabal init

This will walk you through the usual fields and create .cabal file for you.

You can also look up any package on hackage and peek into its .cabal file

;)



On 24 August 2018 at 22:22, Jack Vice <jack.v...@gmail.com> wrote:

> I am attempting my first sandbox build with a cabal package (Chart) and I
> don't know what to put in my cabal.config file after looking at these sites:
> https://www.haskell.org/cabal/users-guide/developing-packages.html
> http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html
> https://wiki.haskell.org/Cabal-Install
>
> I am getting the following build error:
> *Building chartHask-0.1.0.0...*
> *Preprocessing executable 'chartHask' for chartHask-0.1.0.0...*
> *[1 of 1] Compiling Main             ( Main.hs,
> dist/build/chartHask/chartHask-tmp/Main.o )*
>
> *Main.hs:5:1: error:*
> *    Failed to load interface for ‘Graphics.Rendering.Chart.Backend.Cairo’*
> *    Perhaps you meant*
> *      Graphics.Rendering.Chart.Backend.Impl (from Chart-1.9)*
> *      Graphics.Rendering.Chart.Backend.Types (from Chart-1.9)*
> *      Graphics.Rendering.Chart.Backend (from Chart-1.9)*
> *    Use -v to see a list of the files searched for.*
>
> So, Maybe I'm dumb or it's not explicit (or both) on how to add a package
> to my cabal.config so it can find it and build.  I tried adding this to my
> cabal.config to no avail:
> *documentation: True*
> *constraints: Chart >= 1.9*
>
> Main.hs (from Chart example:
> *module Main where*
>
> *import Graphics.Rendering.Chart.Easy*
> *import Graphics.Rendering.Chart.Backend.Cairo*
>
> *signal :: [Double] -> [(Double,Double)]*
> *signal xs = [ (x,(sin (x*3.14159/45) + 1) / 2 * (sin (x*3.14159/5))) | x
> <- xs ]*
>
> *main = toFile def "example1_big.png" $ do*
> *    layout_title .= "Amplitude Modulation"*
> *    setColors [opaque blue, opaque red]*
> *    plot (line "am" [signal [0,(0.5)..400]])*
> *    plot (points "am points" (signal [0,7..400]))*
>
> Or should I be using Stack? (probably private email or new thread question)
>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20180824/6cd73ff6/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 122, Issue 18
******************************************

Reply via email to