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:  Noobie attempt to process log output into dependency
      graph (John Lusk)
   2. Re:  Noobie attempt to process log output into    dependency
      graph (Magnus Therning)
   3. Re:  Noobie attempt to process log output into    dependency
      graph (Magnus Therning)
   4. Re:  Noobie attempt to process log output into dependency
      graph (John Lusk)


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

Message: 1
Date: Fri, 16 Dec 2016 16:54:39 -0500
From: John Lusk <johnlu...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Noobie attempt to process log output
        into dependency graph
Message-ID:
        <CAJQkMba5NRPzRGGV564RtqhM6sjtS+mMhiwd=asomt+v9ic...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Ha! Fixed! And committed to the GitHub repo mentioned previously, if
anybody's interested.

I spent too much time on it, but I couldn't let it go and now I have to
brag.

John.

On Thu, Dec 15, 2016 at 4:25 PM, John Lusk <johnlu...@gmail.com> wrote:

> Thanks!!
>
> John.
>
> On Thu, Dec 15, 2016 at 4:23 PM, Imants Cekusins <ima...@gmail.com> wrote:
>
>> > f :: [input] -> state -> outputs
>>
>> .. or with state monad m it could be a combination of
>>
>> f :: [input] -> m outputs
>>
>> f :: [input] -> outputs  - for intermediate results where state is not R/W
>>
>>
>> state + IO is not too difficult. here is a very good explanation
>> <http://stackoverflow.com/questions/3640120/combine-state-with-io-actions>
>> I understood the last one - Use liftIO - best
>>
>> _______________________________________________
>> 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/20161216/50ddff38/attachment-0001.html>

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

Message: 2
Date: Sat, 17 Dec 2016 02:03:21 +0100
From: Magnus Therning <mag...@therning.org>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Noobie attempt to process log output
        into    dependency graph
Message-ID: <87pokrtlie....@therning.org>
Content-Type: text/plain; charset="utf-8"


John Lusk <john-hask...@how-hard-can-it-be.com> writes:

> Thanks, all, that gives me something to chew on.
>
> It occurred to me (during my 45-minute commute to work) that all
> Haskell programs (listen to the noob <eyeroll/>) have the following
> structure (modulo my fractured syntax):
>
> main :: IO()
> main = do
>   inputs <- getInputs
>   doOutput $ f inputs initialState
>
> f :: [input] -> state -> outputs
>
> f [] state =
>   transformToOutputs state
>
> f (input:inputs) state =
>   f inputs (newState state input)
>
> doOutput :: [output] -> IO()
>
> doOutput outputs = do
>   putStr $ unlines outputs
>
> So all I have to do is write newState and I'm good! ^_^
>
> (transformToOutputs will, of course, be a snap.)
>
> Right?

Very many do, yes. One thing though, it is worth thinking about the
order of arguments. I often order it

     f state [] = ...
     f state (x:xs) = ...

because that fits better with `foldl` and `map` :)

/M

--
Magnus Therning              OpenPGP: 0x927912051716CE39
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe               http://therning.org/magnus

The early bird may get the worm, but the second mouse gets the cheese.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20161217/b59d7c46/attachment-0001.sig>

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

Message: 3
Date: Sat, 17 Dec 2016 02:05:46 +0100
From: Magnus Therning <mag...@therning.org>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Noobie attempt to process log output
        into    dependency graph
Message-ID: <87oa0btled....@therning.org>
Content-Type: text/plain; charset="utf-8"


John Lusk <johnlu...@gmail.com> writes:

> Ha! Fixed! And committed to the GitHub repo mentioned previously, if
> anybody's interested.
>
> I spent too much time on it, but I couldn't let it go and now I have
> to brag.

Excellent!

If you have use for it in the future, but find that it's too slow or
demanding on memory then I *think* it's possible to skip building the
full tree and instead use a stack :)

/M

--
Magnus Therning              OpenPGP: 0x927912051716CE39
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe               http://therning.org/magnus

Finagle's Fourth Law:
Once a job is fouled up, anything done to improve it only makes it
worse.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20161217/8eb51e1e/attachment-0001.sig>

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

Message: 4
Date: Fri, 16 Dec 2016 20:17:15 -0500
From: John Lusk <johnlu...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Noobie attempt to process log output
        into dependency graph
Message-ID:
        <cajqkmby9bh74uad1e4mgjgauds7ukfwxewtovlvp+eutikw...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I'm actually already building a stack and using a set (disguised as a map)
to coalesce duplicate edges, but I have a big file to process next week, so
I'll let you know.

I had actually thought that I could find an artful way to conceal the
stack-as-data-structure as a stack-as-runtime-call-structure, but that was
beyond my capabilities, alas. :(

Maybe someday.

On Fri, Dec 16, 2016 at 8:05 PM, Magnus Therning <mag...@therning.org>
wrote:

>
> John Lusk <johnlu...@gmail.com> writes:
>
> > Ha! Fixed! And committed to the GitHub repo mentioned previously, if
> > anybody's interested.
> >
> > I spent too much time on it, but I couldn't let it go and now I have
> > to brag.
>
> Excellent!
>
> If you have use for it in the future, but find that it's too slow or
> demanding on memory then I *think* it's possible to skip building the
> full tree and instead use a stack :)
>
> /M
>
> --
> Magnus Therning              OpenPGP: 0x927912051716CE39
> email: mag...@therning.org   jabber: mag...@therning.org
> twitter: magthe               http://therning.org/magnus
>
> Finagle's Fourth Law:
> Once a job is fouled up, anything done to improve it only makes it
> worse.
>
> _______________________________________________
> 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/20161216/8b4fc607/attachment-0001.html>

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

Subject: Digest Footer

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


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

End of Beginners Digest, Vol 102, Issue 10
******************************************

Reply via email to