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: Application of lookup function (Jeon-Young Kang) 2. debugging help (Dennis Raddle) 3. Re: debugging help (Magnus Therning) 4. Re: debugging help (Dennis Raddle) ---------------------------------------------------------------------- Message: 1 Date: Fri, 4 Dec 2015 17:16:55 -0500 From: Jeon-Young Kang <jykan...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Application of lookup function Message-ID: <CALWtiK8Xx9RMwBfzv=LHHcmHhCTG=6AajD8wF5=7vtuozud...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Thanks Alex. I successfully implemented what I want by using 'elem'. On Thu, Dec 3, 2015 at 11:50 PM, Alex Belanger <i.caught....@gmail.com> wrote: > The (`elem` members) function will tell you if the person is a member of > members. You can then turn that boolean into your custom State type. > On Dec 3, 2015 11:46 PM, "Jeon-Young Kang" <jykan...@gmail.com> wrote: > >> Hi all. >> >> I'd like to apply lookup function (Data.Map) for what I am working on. >> >> Here is my code. >> >> data Person = Person {personId :: Int, name = String} >> data People = [Person] >> >> data State = InMembership | NoMemebership >> >> person1 = Person {1 = personId, "James" = name} >> person2 = Person {2 = personId, "Tom" = name} >> >> members = People [person1, person2] >> >> class Belonging a where >> belonging :: a -> [a] -> Bool -> State >> >> here is the problem... >> I don't know how to get to know whether a person is belong to members. >> I'd like to find it through a person's name. >> >> Can you suggest any examples?? >> >> Sincerely, >> Jeon >> >> >> >> _______________________________________________ >> 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 > > -- Department of Geography State University of New York at Buffalo jykan...@gmail.com Jeon-Young Kang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151204/6872a09d/attachment-0001.html> ------------------------------ Message: 2 Date: Fri, 4 Dec 2015 16:50:22 -0800 From: Dennis Raddle <dennis.rad...@gmail.com> To: Haskell Beginners <beginners@haskell.org> Subject: [Haskell-beginners] debugging help Message-ID: <CAKxLvorg0iGe6qKpJZwzVsfLEAVs-7iewsoaUHpN0vNfcn=j...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" I'm getting an error, printf not having enough arguments. I need to find where this is happening, and I understand there are ways of getting a stack trace, but apparently I need to compile for profiling. That means I need to compile my one library dependency (Text.XML.Light) for profiling, I believe. How do I do this? I'm on Windows and have only installed libraries in the past with cabal. D -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151204/fca66498/attachment-0001.html> ------------------------------ Message: 3 Date: Sat, 05 Dec 2015 09:11:10 +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] debugging help Message-ID: <87bna58gdd....@therning.org> Content-Type: text/plain; charset="us-ascii" Dennis Raddle writes: > I'm getting an error, printf not having enough arguments. I need to > find where this is happening, and I understand there are ways of > getting a stack trace, but apparently I need to compile for profiling. > That means I need to compile my one library dependency > (Text.XML.Light) for profiling, I believe. How do I do this? I'm on > Windows and have only installed libraries in the past with cabal. How many calls to `printf` do you actually have? Wouldn't a search for all calls and a quick inspection of them be good enough? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus If our ideas of intellectual property are wrong, we must change them, improve them and return them to their original purpose. When intellectual property rules diminish the supply of new ideas, they steal from all of us. -- Andrew Brown, November 19, 2005, The Guardian -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 162 bytes Desc: not available URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151205/71d454ae/attachment-0001.sig> ------------------------------ Message: 4 Date: Sat, 5 Dec 2015 02:18:41 -0800 From: Dennis Raddle <dennis.rad...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] debugging help Message-ID: <CAKxLvorcraEVMjyYGBG3R=_vv8tytpb+louzvjmh+sw_ieq...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" I started by looking everywhere I thought I called printf in this particular case, and couldn't find a single problematic printf. Given the input I was using, I thought I knew where the printf was probably going to be. But that failed, and there are hundreds throughout the rest of the program. (I use them for generating output and warning/error messages--- I happen to like the format string method of describing your output.) Then I thought, I sure would like to learn more about the debugger and profiling, so I thought it was worth asking. I never have gotten clear on how to compile libraries for profiling. While waiting for a reply here, it struck me where the printf was, and I found it and solved the problem. So there's not an immediate need for the stack trace. D On Sat, Dec 5, 2015 at 12:11 AM, Magnus Therning <mag...@therning.org> wrote: > > Dennis Raddle writes: > > > I'm getting an error, printf not having enough arguments. I need to > > find where this is happening, and I understand there are ways of > > getting a stack trace, but apparently I need to compile for profiling. > > That means I need to compile my one library dependency > > (Text.XML.Light) for profiling, I believe. How do I do this? I'm on > > Windows and have only installed libraries in the past with cabal. > > How many calls to `printf` do you actually have? > > Wouldn't a search for all calls and a quick inspection of them be good > enough? > > /M > > -- > Magnus Therning OpenPGP: 0xAB4DFBA4 > email: mag...@therning.org jabber: mag...@therning.org > twitter: magthe http://therning.org/magnus > > If our ideas of intellectual property are wrong, we must change them, > improve them and return them to their original purpose. When > intellectual property rules diminish the supply of new ideas, they > steal from all of us. > -- Andrew Brown, November 19, 2005, The Guardian > > _______________________________________________ > 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/20151205/448b1646/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 90, Issue 8 ****************************************