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: Parametrizing [] as an instance of the Functor type class (Olumide) 2. Re: Parametrizing [] as an instance of the Functor type class (Olumide) 3. Re: Ambiguous module name `Prelude': it was found in multiple packages (trying to install HXQ) (Stanislaw Findeisen) 4. Re: Ambiguous module name `Prelude': it was found in multiple packages (trying to install HXQ) (Stanislaw Findeisen) 5. Re: Parametrizing [] as an instance of the Functor type class (Rein Henrichs) 6. Re: Ambiguous module name `Prelude': it was found in multiple packages (trying to install HXQ) (Henk-Jan van Tuyl) ---------------------------------------------------------------------- Message: 1 Date: Tue, 5 Jan 2016 13:33:30 +0000 From: Olumide <50...@web.de> To: beginners@haskell.org Subject: Re: [Haskell-beginners] Parametrizing [] as an instance of the Functor type class Message-ID: <568bc62a.3070...@web.de> Content-Type: text/plain; charset=windows-1252; format=flowed On 31/12/2015 13:06, Olumide wrote: > ... considering that Functor is defined as > > class Functor f > where fmap :: (a -> b) -> f a -> f b > Still on the subject, according to LYH, the above definition(?) is read thusly: "fmap takes a function from one type as to another and a functor value applied with one type and returns a functor value applied with another type". So if list is "a part of the part of the Functor type class" (quoting LYH) how am I to grok a list e.g. [1,2,3] as a "functor value applied to a type"? Thanks, - Olumide ------------------------------ Message: 2 Date: Tue, 5 Jan 2016 13:59:00 +0000 From: Olumide <50...@web.de> To: beginners@haskell.org Subject: Re: [Haskell-beginners] Parametrizing [] as an instance of the Functor type class Message-ID: <568bcc24.4020...@web.de> Content-Type: text/plain; charset=utf-8; format=flowed On 01/01/2016 19:41, Alexander Berntsen wrote: >> Can you please give an example of [] used as a type constructor? > Whenever you write a list type, e.g. [Int], you are using [] as a type > constructor. The fact that you can write [Int] instead of '[] Int' is > simply syntax sugar. > > We can imagine the simple function that returns the first element of a > list, if there is one. > > head :: [a] -> Maybe a > head [] = Nothing > head (x:xs) = Just x > > Here we use [] both on type and term level. On type level we use it to > mean a list of 'a's, and on term level we use it to mean the empty list. Out of curiosity, is [] defined as type constructor _and_ term level at the library level or in the language/compiler? (BTW, google tells me "term-level" has a special meaning that I do not yet know.) Note: I've deferred reading your explanation of kinds because (1) I am still trying to get to grips with Functors and (2) the section on kinds is just two pages away from where I am in the book. So if these questions are answered by kinds please let me know. Thanks for your patience, - Olumide ------------------------------ Message: 3 Date: Tue, 5 Jan 2016 18:24:15 +0100 From: Stanislaw Findeisen <waka.2...@eisenbits.com> To: beginners@haskell.org Subject: Re: [Haskell-beginners] Ambiguous module name `Prelude': it was found in multiple packages (trying to install HXQ) Message-ID: <568bfc3f.5090...@eisenbits.com> Content-Type: text/plain; charset=windows-1252; format=flowed On 2016-01-05 12:44, Martin Vlk wrote: > Also it is recommended to install things into project specific sandboxes > rather than globally. > > E.g. > > mkdir myProj > cd myProj > cabal sandbox init > cabal install hxq Thanks but it doesn't help. :/ -- http://people.eisenbits.com/~stf/ http://www.eisenbits.com/ OpenPGP: 9EC2 5620 2355 B1DC 4A8F 8C79 0EC7 C214 E5AE 3B4E ------------------------------ Message: 4 Date: Tue, 5 Jan 2016 18:25:10 +0100 From: Stanislaw Findeisen <waka.2...@eisenbits.com> To: Henk-Jan van Tuyl <hjgt...@chello.nl>, beginners@haskell.org Subject: Re: [Haskell-beginners] Ambiguous module name `Prelude': it was found in multiple packages (trying to install HXQ) Message-ID: <568bfc76.4000...@eisenbits.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed On 2016-01-05 01:56, Henk-Jan van Tuyl wrote: > On Mon, 04 Jan 2016 16:59:13 +0100, Stanislaw Findeisen > <waka.2...@eisenbits.com> wrote: > > [...] >> src/Text/XML/HXQ/XQuery.hs:1:1: >> Ambiguous module name `Prelude': >> it was found in multiple packages: base haskell98-2.0.0.2 >> cabal: Error: some packages failed to install: >> HXQ-0.19.0 failed during the building phase. The exception was: >> ExitFailure 1 > > I think the answer is given at: > http://stackoverflow.com/questions/7339635/ambiguous-module-name-prelude > > HXQ is not updated since 2011; the package haskell98 should be removed > from the dependencies. Ok, so how can one use HXQ in a project? -- http://people.eisenbits.com/~stf/ http://www.eisenbits.com/ OpenPGP: 9EC2 5620 2355 B1DC 4A8F 8C79 0EC7 C214 E5AE 3B4E ------------------------------ Message: 5 Date: Tue, 05 Jan 2016 18:57:09 +0000 From: Rein Henrichs <rein.henri...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Parametrizing [] as an instance of the Functor type class Message-ID: <cajp6g8whkmbvjg3g+r79jltjcn+cxsqtyyufzvq4uvcnnup...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" [1,2,3] is [Int] or [] Int (if we take the numbers to be Ints for simplicity). It is the [] type constructor applied to the Int type. On Tue, Jan 5, 2016 at 5:59 AM Olumide <50...@web.de> wrote: > On 01/01/2016 19:41, Alexander Berntsen wrote: > >> Can you please give an example of [] used as a type constructor? > > Whenever you write a list type, e.g. [Int], you are using [] as a type > > constructor. The fact that you can write [Int] instead of '[] Int' is > > simply syntax sugar. > > > > We can imagine the simple function that returns the first element of a > > list, if there is one. > > > > head :: [a] -> Maybe a > > head [] = Nothing > > head (x:xs) = Just x > > > > Here we use [] both on type and term level. On type level we use it to > > mean a list of 'a's, and on term level we use it to mean the empty list. > > Out of curiosity, is [] defined as type constructor _and_ term level at > the library level or in the language/compiler? (BTW, google tells me > "term-level" has a special meaning that I do not yet know.) > > Note: I've deferred reading your explanation of kinds because (1) I am > still trying to get to grips with Functors and (2) the section on kinds > is just two pages away from where I am in the book. So if these > questions are answered by kinds please let me know. > > Thanks for your patience, > > - Olumide > > _______________________________________________ > 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/20160105/978b12d1/attachment-0001.html> ------------------------------ Message: 6 Date: Tue, 05 Jan 2016 22:16:57 +0100 From: "Henk-Jan van Tuyl" <hjgt...@chello.nl> To: beginners@haskell.org, "Stanislaw Findeisen" <waka.2...@eisenbits.com> Subject: Re: [Haskell-beginners] Ambiguous module name `Prelude': it was found in multiple packages (trying to install HXQ) Message-ID: <op.yasaqj1fpz0j5l@alquantor> Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes On Tue, 05 Jan 2016 18:25:10 +0100, Stanislaw Findeisen <waka.2...@eisenbits.com> wrote: > On 2016-01-05 01:56, Henk-Jan van Tuyl wrote: >> On Mon, 04 Jan 2016 16:59:13 +0100, Stanislaw Findeisen >> <waka.2...@eisenbits.com> wrote: >> >> [...] >>> src/Text/XML/HXQ/XQuery.hs:1:1: >>> Ambiguous module name `Prelude': >>> it was found in multiple packages: base haskell98-2.0.0.2 >>> cabal: Error: some packages failed to install: >>> HXQ-0.19.0 failed during the building phase. The exception was: >>> ExitFailure 1 >> >> I think the answer is given at: >> http://stackoverflow.com/questions/7339635/ambiguous-module-name-prelude >> >> HXQ is not updated since 2011; the package haskell98 should be removed >> from the dependencies. > > Ok, so how can one use HXQ in a project? > You can do "cabal unpack hxq" and update the file hxq.cabal; I tried it and there are many more things that need updates. Your best bet would be to ask the author to update the package. Otherwise, you could ask the Haskell Caf? if someone would like to take over maintenance of HXQ. Regards, Henk-Jan van Tuyl -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -- ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 91, Issue 9 ****************************************