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: Fw: [Haskell-beginners] Installing package hsc3 ? Haskell
supercollider (Kyle Murphy)
2. haskell scheduling (Nowshad)
3. help using Data.Map lookup - how to get values after the
"Just" constructor (Martin Tomko)
4. Re: help using Data.Map lookup - how to get values after the
"Just" constructor (edgar klerks)
5. Re: help using Data.Map lookup - how to get values after the
"Just" constructor (edgar klerks)
----------------------------------------------------------------------
Message: 1
Date: Tue, 21 Sep 2010 00:48:51 -0400
From: Kyle Murphy <[email protected]>
Subject: Re: Fw: [Haskell-beginners] Installing package hsc3 ? Haskell
supercollider
To: Deb Midya <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
Are you behind a firewall, or a proxy? Cabal doesn't seem to play well with
corporate networks and proxies.
-R. Kyle Murphy
--
Curiosity was framed, Ignorance killed the cat.
On Sun, Sep 19, 2010 at 21:42, Deb Midya <[email protected]> wrote:
> Ozgur,
>
> Thanks for your reply.
>
> I have tried with at ghc command prompt:
>
> ghc>cabal update -v
>
> But the the message remains the same as before:
>
> Downloading the latest package list from hackage.haskell.org
> cabal: failed
> Is the any method to install manually? or if any.
>
> Regards,
>
> Deb
>
> --- On *Mon, 20/9/10, Ozgur Akgun <[email protected]>* wrote:
>
>
> From: Ozgur Akgun <[email protected]>
> Subject: Re: Fw: [Haskell-beginners] Installing package hsc3 â Haskell
> supercollider
> To: "Deb Midya" <[email protected]>
> Cc: [email protected]
> Received: Monday, 20 September, 2010, 10:48 AM
>
>
>
> On 20 September 2010 00:33, Deb Midya
> <[email protected]<http://au.mc543.mail.yahoo.com/mc/[email protected]>
> > wrote:
>
> At DOS prompt, I typed: \ghc> cabal update
>
> The following message appears:
>
> Downloading the latest package list from hackage.haskell.org
> cabal: failed
>
> Is there any solution for it please?
>
>
> To start with, you can run cabal update -v to get a more detailed output
> about the cause of the failure.
>
> Ozgur
>
>
>
> _______________________________________________
> 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/20100920/10410e02/attachment-0001.html
------------------------------
Message: 2
Date: Fri, 17 Sep 2010 02:08:27 +0200
From: Nowshad <[email protected]>
Subject: [Haskell-beginners] haskell scheduling
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi
Hope that You are doing fine. I am stuck at this problem if you have any
idea kindly help me out.
I want to output the schedule for a given task and method for one hyper
period....like (o, just (T4 3 1 3 1), (1, Just (T2 5 1 51) etc
Regards
Nowshad
data Task = T4 Phase Period Execution Deadline
| T2 Period Execution
deriving (Show ,Eq)
type Phase = TimeUnit
type Period = TimeUnit
type Execution = TimeUnit
type Deadline = TimeUnit
type TimeUnit = Int
data Method = RM
| DM
| EDF
deriving (Show , Eq)
periodicSchedule :: Method -> [Task] -> [(TimeUnit, Maybe Task)]
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20100916/b7f97db2/attachment-0001.html
------------------------------
Message: 3
Date: Tue, 21 Sep 2010 15:05:19 +0200
From: Martin Tomko <[email protected]>
Subject: [Haskell-beginners] help using Data.Map lookup - how to get
values after the "Just" constructor
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Dear All,
as a newbie, I am only just discovering some intricacies of haskell.
I have a Data.Map map, and am trying the lookup function to get the
value for a given key (it is a list in my case, btw). I am struggling to
get access to the value, as it is constructed using Just. I know that
the question is therefore more general then the application on Map, so I
would be glad to get a wider picture. I Checked in Real World Haskell,
btu did nto find and answer. In Haskell the craft of... I found the
following (p263):
mapValue :: (a->b)-> Maybe a -> Maybe b
mapValue g (Just a) = Just (g a)
mapValue g Nothing = Nothing
Which is fine, but it makes the Just constructor travel through the
whole code, which is annoying. Is there a way out? Or would that be a
dirty hack?
I do not quite understand the following discussion of maybe (p263-4),
but it seems like the code suggested is able to return a value at the end...
Thanks
Martin
------------------------------
Message: 4
Date: Tue, 21 Sep 2010 15:15:09 +0200
From: edgar klerks <[email protected]>
Subject: Re: [Haskell-beginners] help using Data.Map lookup - how to
get values after the "Just" constructor
To: [email protected]
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hello Martin,
You have two options. You can use fromJust :: Maybe a -> a, which is a
partial function, so it can fail if the supplied value is Nothing and gives
a hard to track down exception.
Or you can use fromMaybe :: a -> Maybe a -> a, which returns a default a in
case Maybe a = Nothing and a if Maybe a = Just a.
There is also a third: maybe :: b -> (a -> b) -> Maybe a -> b, which can be
useful in the last step of some chain of functions. Note that fromMaybe is
just (flip maybe id).
Greets,
Edgar
On Tue, Sep 21, 2010 at 3:05 PM, Martin Tomko <[email protected]>wrote:
> Dear All,
> as a newbie, I am only just discovering some intricacies of haskell.
> I have a Data.Map map, and am trying the lookup function to get the value
> for a given key (it is a list in my case, btw). I am struggling to get
> access to the value, as it is constructed using Just. I know that the
> question is therefore more general then the application on Map, so I would
> be glad to get a wider picture. I Checked in Real World Haskell, btu did nto
> find and answer. In Haskell the craft of... I found the following (p263):
>
> mapValue :: (a->b)-> Maybe a -> Maybe b
> mapValue g (Just a) = Just (g a)
> mapValue g Nothing = Nothing
>
> Which is fine, but it makes the Just constructor travel through the whole
> code, which is annoying. Is there a way out? Or would that be a dirty hack?
>
> I do not quite understand the following discussion of maybe (p263-4), but
> it seems like the code suggested is able to return a value at the end...
>
> Thanks
> Martin
>
> _______________________________________________
> 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/20100921/a9cff8b0/attachment-0001.html
------------------------------
Message: 5
Date: Tue, 21 Sep 2010 15:19:03 +0200
From: edgar klerks <[email protected]>
Subject: Re: [Haskell-beginners] help using Data.Map lookup - how to
get values after the "Just" constructor
To: [email protected]
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Also note that Maybe is a monad. So you don't have to use pattern matching.
Try for example in ghci: fromJust $ Just 1 >>= (\x -> return $ x + 1)
You have to import the Data.Maybe to get the functions in the scope.
On Tue, Sep 21, 2010 at 3:15 PM, edgar klerks <[email protected]>wrote:
> Hello Martin,
>
> You have two options. You can use fromJust :: Maybe a -> a, which is a
> partial function, so it can fail if the supplied value is Nothing and gives
> a hard to track down exception.
>
> Or you can use fromMaybe :: a -> Maybe a -> a, which returns a default a
> in case Maybe a = Nothing and a if Maybe a = Just a.
>
> There is also a third: maybe :: b -> (a -> b) -> Maybe a -> b, which can be
> useful in the last step of some chain of functions. Note that fromMaybe is
> just (flip maybe id).
>
> Greets,
>
> Edgar
>
> On Tue, Sep 21, 2010 at 3:05 PM, Martin Tomko <[email protected]>wrote:
>
>> Dear All,
>> as a newbie, I am only just discovering some intricacies of haskell.
>> I have a Data.Map map, and am trying the lookup function to get the value
>> for a given key (it is a list in my case, btw). I am struggling to get
>> access to the value, as it is constructed using Just. I know that the
>> question is therefore more general then the application on Map, so I would
>> be glad to get a wider picture. I Checked in Real World Haskell, btu did nto
>> find and answer. In Haskell the craft of... I found the following (p263):
>>
>> mapValue :: (a->b)-> Maybe a -> Maybe b
>> mapValue g (Just a) = Just (g a)
>> mapValue g Nothing = Nothing
>>
>> Which is fine, but it makes the Just constructor travel through the whole
>> code, which is annoying. Is there a way out? Or would that be a dirty hack?
>>
>> I do not quite understand the following discussion of maybe (p263-4), but
>> it seems like the code suggested is able to return a value at the end...
>>
>> Thanks
>> Martin
>>
>> _______________________________________________
>> 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/20100921/deec0f78/attachment.html
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 27, Issue 47
*****************************************