Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

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


Today's Topics:

   1. Re:  Fish tank monad (Adrian May)
   2. Re:  Fish tank monad (Stephen Tetley)
   3.  installing text-icu on Mac OSX with cabal (7stud)
   4. Re:  installing text-icu on Mac OSX with cabal (Brandon Allbery)
   5. Re:  installing text-icu on Mac OSX with cabal (yi lu)
   6. Re:  Fish tank monad (Adrian May)


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

Message: 1
Date: Sat, 18 May 2013 20:10:18 +0800
From: Adrian May <[email protected]>
Subject: Re: [Haskell-beginners] Fish tank monad
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAD-UbzEu9bKQCvvp0uKhFbeGcL_6Lmq=4vfc89smj2tzddc...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Thanks! In the mean time I figured out that I need something completely
different though. Actually, they're not fish, they're assorted programmers,
and I need to approach the hiring plan with tasks (as in the Gantt chart
code at http://nuerd.blogspot.com) calling for certain skills and get a
possibly non-contiguous booking. A Timed Integer won't support that though,
unless I step through it day by day which would seem needlessly goofy. It's
at brainstorming stage right now but I think I can probably plough through
it, then I'll probably be back asking for help with boilerplate reduction.

Adrian.
 On 18 May 2013 14:48, "Ertugrul S?ylemez" <[email protected]> wrote:

> Adrian May <[email protected]> wrote:
>
> > I want to model a fish tank as a function of time onto how many fish
> > there are in it at that time. If I already have such a function, I
> > want to operate on it with something like "add 2 fish on day 20" or
> > "take 3 away on day 15" to get a new function of the same form, but
> > the latter should not remove more fish than there are in the tank at
> > that time, and it should tell me how many I get. I don't promise to
> > apply these operators in chronological order.
> >
> > This seems like the kind of thing that would be in the prelude
> > somewhere. But where?
>
> Let's see.  You want to model a "number of fish" value:
>
>     Integer
>
> but that value depends on time:
>
>     Time -> Integer
>
> So you have a "what do I get?" and a "how do I get it?".  The former can
> be abstracted away:
>
>     type Timed a = Time -> a
>     type Timed a = (->) Time a
>     type Timed = (->) Time
>
> And yes, Timed is a monad.  You may know it as Reader Time, but Reader
> is just (->) in disguise.  However, you don't need it to be a monad:
>
>     applyAt :: Time -> (a -> a) -> Timed a -> Timed a
>     applyAt tEv f c t
>         | t >= tEv  = f (c t)
>         | otherwise = c t
>
> Then you can add two fish on day 20:
>
>     applyAt 20 (+ 2)
>
> and take 3 away on day 15:
>
>     applyAt 15 (subtract 3)
>
> Have fun. =)
>
>
> Greets,
> Ertugrul
>
> --
> Not to be or to be and (not to be or to be and (not to be or to be and
> (not to be or to be and ... that is the list monad.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130518/702a5170/attachment-0001.htm>

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

Message: 2
Date: Sat, 18 May 2013 17:14:37 +0100
From: Stephen Tetley <[email protected]>
Subject: Re: [Haskell-beginners] Fish tank monad
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAB2TPRDy2=t1gjpvmww9+nbhgfufg4e7xf9pm-uupqu_mzu...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Are you wanting to draw schedules or calculate them?

Calculating schedules is a model problem within the logic programming
community - a language like Oz might be better suited to the task than
Haskell (Oz having more developed infrastructure and literature in
this area).



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

Message: 3
Date: Sat, 18 May 2013 21:44:29 -0400
From: "7stud" <[email protected]>
Subject: [Haskell-beginners] installing text-icu on Mac OSX with cabal
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

I want to try unicode with haskell, and the Data.Text docs say I need text-icu. 
This is what I tried:

Mac OS X 10.6.8

~/haskell_programs$ cabal update
Downloading the latest package list from hackage.haskell.org

~/haskell_programs$ cabal install text-icu
Resolving dependencies...
Downloading text-icu-0.6.3.5...
Configuring text-icu-0.6.3.5...
cabal: Missing dependencies on foreign libraries:
* Missing C libraries: icui18n, icudata, icuuc
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
Failed to install text-icu-0.6.3.5
cabal: Error: some packages failed to install:
text-icu-0.6.3.5 failed during the configure step. The exception was:
ExitFailure 1
I found a post by a Windows user who had the same problem. Do I really need to 
go out and install those C libraries? Or are they 'misplaced' somewhere on my 
system?

Thanks.



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

Message: 4
Date: Sat, 18 May 2013 21:48:26 -0400
From: Brandon Allbery <[email protected]>
Subject: Re: [Haskell-beginners] installing text-icu on Mac OSX with
        cabal
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAKFCL4WEp2xht7Z=rv3cioviep-8vtiunc8g7ed3jagrj1j...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Sat, May 18, 2013 at 9:44 PM, 7stud <[email protected]> wrote:

> * Missing C libraries: icui18n, icudata, icuuc
> I found a post by a Windows user who had the same problem. Do I really
> need to go out and install those C libraries? Or are they 'misplaced'
> somewhere on my system?
>

Neither Windows nor OS X comes with those libraries.

-- 
brandon s allbery kf8nh                               sine nomine associates
[email protected]                                  [email protected]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130518/ba49b070/attachment-0001.htm>

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

Message: 5
Date: Sun, 19 May 2013 09:58:14 +0800
From: yi lu <[email protected]>
Subject: Re: [Haskell-beginners] installing text-icu on Mac OSX with
        cabal
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAKcmqqz1fS-5hdFZEvSr6g9L9VOODEsQk8pgseCUv7=ntcn...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

* Missing C libraries: icui18n, icudata, icuuc


On Sun, May 19, 2013 at 9:44 AM, 7stud <[email protected]> wrote:

> I want to try unicode with haskell, and the Data.Text docs say I need
> text-icu. This is what I tried:
>
> Mac OS X 10.6.8
>
> ~/haskell_programs$ cabal update
> Downloading the latest package list from hackage.haskell.org
>
> ~/haskell_programs$ cabal install text-icu
> Resolving dependencies...
> Downloading text-icu-0.6.3.5...
> Configuring text-icu-0.6.3.5...
> cabal: Missing dependencies on foreign libraries:
> * Missing C libraries: icui18n, icudata, icuuc
> This problem can usually be solved by installing the system packages that
> provide these libraries (you may need the "-dev" versions). If the
> libraries
> are already installed but in a non-standard location then you can use the
> flags --extra-include-dirs= and --extra-lib-dirs= to specify where they
> are.
> Failed to install text-icu-0.6.3.5
> cabal: Error: some packages failed to install:
> text-icu-0.6.3.5 failed during the configure step. The exception was:
> ExitFailure 1
> I found a post by a Windows user who had the same problem. Do I really
> need to go out and install those C libraries? Or are they 'misplaced'
> somewhere on my system?
>
> Thanks.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130519/76affd88/attachment-0001.htm>

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

Message: 6
Date: Sun, 19 May 2013 11:42:53 +0800
From: Adrian May <[email protected]>
Subject: Re: [Haskell-beginners] Fish tank monad
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <CAD-UbzFJawqpPaaMyvsB5yiUaAWqfw1-=lxw11bayzotdkz...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On 19 May 2013 00:16, "Stephen Tetley" <[email protected]> wrote:
>
> Are you wanting to draw schedules or calculate them?

Originally the former, but it grew into the latter.

>
> Calculating schedules is a model problem within the logic programming
> community - a language like Oz might be better suited to the task than
> Haskell (Oz having more developed infrastructure and literature in
> this area).

That's a good idea. I once did something like this in prolog. But rather
than start afresh in a language where I need keywords to say that something
is a function, or that it's lazy, I'm looking at the monadiccp package. No
need to care about performance.

BTW, anybody know if there's a backend for Diagrams that draws HTML5
elements?

Adrian.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130519/b39a2128/attachment.htm>

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

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 59, Issue 24
*****************************************

Reply via email to