Send Beginners mailing list submissions to
[email protected]
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
[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: cyclic dependency problem (Konstantin Saveljev)
2. Using LTS et. al, a small thank you. (emacstheviking)
3. Re: Using LTS et. al, a small thank you. (Dimitri DeFigueiredo)
4. <$> and <*> pronunciation (Max Schneider)
5. Re: <$> and <*> pronunciation (Francesco Ariis)
----------------------------------------------------------------------
Message: 1
Date: Thu, 5 Mar 2015 17:07:13 +0200
From: Konstantin Saveljev <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] cyclic dependency problem
Message-ID:
<CAKncEjrWdY3MyCpAGHfiOoaVWe_5r0mW=j0x_vufbmqkgy+...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Guys, I'm so sorry. It actually turned out to be the problem with
makeLenses (from Control.Lens) which I also put into the same module. Now
that this stuff is in separate modules everything works and deriving is not
a problem. I'm so sorry for wasting you time and thank you very much for
your help.
Konstantin
On Thu, Mar 5, 2015 at 4:50 PM, Konstantin Saveljev <
[email protected]> wrote:
> Would this be a correct implementation?:
>
> {-# LANGUAGE MultiParamTypeClasses #-} -- for some reason compiler
> says to use it ?
>
> import qualified Control.Monad.State.Lazy as Lazy
>
> instance MonadState MyState X where
> get = X Lazy.get
> put s = X $ Lazy.put s
>
>
> Konstantin
>
> On Thu, Mar 5, 2015 at 4:37 PM, Konstantin Saveljev <
> [email protected]> wrote:
>
>> I believe Francesco has a point here. I do have "deriving (MonadState
>> MyState)" which is probably causing the problem.
>>
>> Unfortunately I'm not capable of writing the instance myself. Maybe
>> someone could help me?
>>
>> My full declaration looks something like this:
>>
>> newtype X a = X (StateT MyState (ExceptT String IO) a)
>> deriving (Functor, Applicative, Monad, MonadIO,
>> MonadError String, MonadState MyState)
>>
>> If I was to remove "MonadState MyState" from the "deriving" section, how
>> would one implement it?
>>
>>
>> Konstantin
>>
>> On Thu, Mar 5, 2015 at 4:25 PM, <[email protected]> wrote:
>>
>>>
>>>
>>> El Mar 5, 2015, a las 8:43, Konstantin Saveljev <
>>> [email protected]> escribi?:
>>>
>>> > Hello,
>>> >
>>> > I'm having some trouble with cyclic dependency.
>>> >
>>> > My simplified version of hierarchy:
>>> >
>>> > module A where
>>> >
>>> > import MyState
>>> >
>>> > data A a = A (StateT MyState IO a) deriving (...)
>>> >
>>> > Now there is a module MyState:
>>> >
>>> > module MyState where
>>> >
>>> > import SomeType
>>> >
>>> > data MyState = MyState { st :: SomeType, ... }
>>> >
>>> > Finally the module that introduces cyclic dependency:
>>> >
>>> > module SomeType where
>>> >
>>> > import A
>>> >
>>> > data SomeType = SomeType { f :: A (), ... }
>>> >
>>> > I have been suggested to move the types into one module and then
>>> import it wherever needed. But the problem is that even if I put them into
>>> one file those three data types still form a cyclic dependency and compiler
>>> throws errors saying "i don't know about this"
>>> >
>>> > So if I have a single module:
>>> >
>>> > data A a = A (StateT MyState IO a) deriving (...)
>>> > data MyState = MyState { st :: SomeType, ... }
>>> > data SomeType = SomeType { f :: A (), ... }
>>> >
>>> > With this setup the compiler is gonna tell us it doesn't know about
>>> MyState. And no matter how we shuffle these types within a file we are
>>> still getting some "unknowns"
>>> >
>>>
>>> Did you try it? It should work fine -- haskell doesn't care about the
>>> order of data declarations within a file.
>>>
>>> Tom
>>>
>>>
>>> > How would one approach such a problem?
>>> >
>>> > Best regards,
>>> > Konstantin
>>> > _______________________________________________
>>> > Beginners mailing list
>>> > [email protected]
>>> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150305/73c2999a/attachment-0001.html>
------------------------------
Message: 2
Date: Thu, 5 Mar 2015 15:22:27 +0000
From: emacstheviking <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] Using LTS et. al, a small thank you.
Message-ID:
<CAEiEuUJ1R5e=r5G6dt1pANk5rX-zEkPH_Tfiog=vG-=r4gn...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
First, find yourself a Pharrel Williams youtube video of Happy!
;)
It might seem crazy what I'm about to say
Functional is here, you can take a break
No more OO confusion that takes up too much space
Punch the air like you don't care it's cool as I say...
Because I code Haskell
Code along if you feel like a project without a boss
Because I code Haskell
Code along if you know that OO is just a bunch of dross
Because I code Haskell
Code along if you know what productivity is to you
Because I code Haskell
Clap along if you that's what you wanna do
I am sure I could write more but that floated in out of nowhere and stuck
as the song came on the radio!! LMAO
In all honesty, I have now got OpenGL, http-client and a bunch of stuff all
playing nicely. Thanks very much everybody for your help yesterday, it's
noce to be hacking Haskell once more.
I'm happy..........
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150305/1da85a42/attachment-0001.html>
------------------------------
Message: 3
Date: Thu, 05 Mar 2015 15:30:09 -0300
From: Dimitri DeFigueiredo <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Using LTS et. al, a small thank you.
Message-ID: <[email protected]>
Content-Type: text/plain; charset="windows-1252"; Format="flowed"
This is the friendliest mailing list I have ever subscribed to.
The people in this list are so nice that even if Haskell were not so
wonderfully elegant, I would like to learn it just to be able to chat
and work with them.
:-)
Dimitri
On 05/03/15 12:22, emacstheviking wrote:
> First, find yourself a Pharrel Williams youtube video of Happy!
>
> ;)
>
> It might seem crazy what I'm about to say
> Functional is here, you can take a break
> No more OO confusion that takes up too much space
> Punch the air like you don't care it's cool as I say...
>
> Because I code Haskell
> Code along if you feel like a project without a boss
> Because I code Haskell
> Code along if you know that OO is just a bunch of dross
> Because I code Haskell
> Code along if you know what productivity is to you
> Because I code Haskell
> Clap along if you that's what you wanna do
>
> I am sure I could write more but that floated in out of nowhere and
> stuck as the song came on the radio!! LMAO
>
>
> In all honesty, I have now got OpenGL, http-client and a bunch of
> stuff all playing nicely. Thanks very much everybody for your help
> yesterday, it's noce to be hacking Haskell once more.
>
> I'm happy..........
>
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150305/eaa6ce57/attachment-0001.html>
------------------------------
Message: 4
Date: Thu, 5 Mar 2015 20:39:13 -0500
From: Max Schneider <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] <$> and <*> pronunciation
Message-ID:
<CAJvnjx2-CgvDTJXe=pot1btXL1444B0xajd1=h_kojnkqdn...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
(I really hope 'no stupid questions' holds here)
I'm not even going to try framing this into a weighty or practical
question; how do you pronounce the <$> and <*> Applicative functions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150305/33e897c3/attachment-0001.html>
------------------------------
Message: 5
Date: Fri, 6 Mar 2015 02:44:44 +0100
From: Francesco Ariis <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] <$> and <*> pronunciation
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Thu, Mar 05, 2015 at 08:39:13PM -0500, Max Schneider wrote:
> [H]ow do you pronounce the <$> and <*> Applicative functions?
Hey Max, <$> is 'mapped to', <*> is 'applied' or 'applied over',
f <$> a <*> b -- reads "f mapped to a applied over b",
-- but I guess it's more idiomatic and
-- clear to say you are 'lifting'
-- function f
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 81, Issue 25
*****************************************