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: Haskell laziness and data structures. (Marcin Mrotek) 2. Re: Haskell laziness and data structures. (OxFord) 3. search function by type (OxFord) 4. Re: search function by type (Andrew Bernard) ---------------------------------------------------------------------- Message: 1 Date: Thu, 7 Jul 2016 19:05:43 +0200 From: Marcin Mrotek <marcin.jan.mro...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Haskell laziness and data structures. Message-ID: <cajcfpzkvkgghsondshxnpgwjb2j3p3x0f2m+jk1merttbcu...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Hello, > Why is there no default O(1) random access list data structure in haskell > (for example clojure has [] vector). I would expect that this kind of data > structure is used very often, so you shouldn't need to import one yourself. Vector (https://hackage.haskell.org/package/vector) can be considered standard for all intents and purposes; it's one of the core libraries (https://wiki.haskell.org/Library_submissions#The_Libraries). Containers in Haskell are in general imported as libraries, it's no different than Map, Set, or Sequence, for example. I'm not sure if it's used all that often in Haskell - it's excellent for numeric code, or other cases when one just needs a big dumb block of data (though streaming with pipes or conduit might be a better solution in some cases), but for otherwise something like IntMap or Sequence might be more useful. >Why is array indexeded by ! and list by !!. Shouldn't they be both instances >of something like Indexable? Indexing a list is O(n) and generally a bad idea. Proliferating type classes just to cover the rare use case of code that is indifferent to whether the indexing is done in O(n) or O(1) seems pointless to me. Best regards, Marcin Mrotek ------------------------------ Message: 2 Date: Thu, 7 Jul 2016 19:16:44 +0200 From: OxFord <fordfo...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Haskell laziness and data structures. Message-ID: <capq-+hkdfy11eqq7xxo-r-rgah85l8-plasaos--sdkckgy...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Thanks ! 2016-07-07 19:05 GMT+02:00 Marcin Mrotek <marcin.jan.mro...@gmail.com>: > Hello, > > > Why is there no default O(1) random access list data structure in haskell > > (for example clojure has [] vector). I would expect that this kind of > data > > structure is used very often, so you shouldn't need to import one > yourself. > > Vector (https://hackage.haskell.org/package/vector) can be considered > standard for all intents and purposes; it's one of the core libraries > (https://wiki.haskell.org/Library_submissions#The_Libraries). > Containers in Haskell are in general imported as libraries, it's no > different than Map, Set, or Sequence, for example. I'm not sure if > it's used all that often in Haskell - it's excellent for numeric code, > or other cases when one just needs a big dumb block of data (though > streaming with pipes or conduit might be a better solution in some > cases), but for otherwise something like IntMap or Sequence might be > more useful. > > >Why is array indexeded by ! and list by !!. Shouldn't they be both > instances of something like Indexable? > > Indexing a list is O(n) and generally a bad idea. Proliferating type > classes just to cover the rare use case of code that is indifferent to > whether the indexing is done in O(n) or O(1) seems pointless to me. > > Best regards, > Marcin Mrotek > _______________________________________________ > 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/20160707/40712e5e/attachment-0001.html> ------------------------------ Message: 3 Date: Thu, 7 Jul 2016 19:30:44 +0200 From: OxFord <fordfo...@gmail.com> To: "beginners@haskell.org" <beginners@haskell.org> Subject: [Haskell-beginners] search function by type Message-ID: <CAPQ-+HLdpH2chgAwqMuj6umd4=8u886jyfa2H1TU=njue6c...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hello, is it possible to search for all functions that have concrete type? For example I want to convert [Char] to [Word], but I don't know whether function for that exist. Or I wanna find contructor for SomeSpecialType and I don't know it's name. Can you search those function in GHCI via some command? E.G. GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help [}{] :searchtype / :st [Char] -> [Word] Found X match(es): foo1 :: (Char -> Word) -> [Char] -> [Word] foo2 :: [Char] -> [Word] ... [}{] :st SomeSpecialType Found 1 match(es): foo3 :: ... -> .. -> SomeSpecialType King Regards, Ford -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160707/fff5fdd0/attachment-0001.html> ------------------------------ Message: 4 Date: Fri, 8 Jul 2016 17:37:22 +1000 From: Andrew Bernard <andrew.bern...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] search function by type Message-ID: <CAK5QfnWPJA7S=ajv+tpjkuz667npjxppwzmvw6sixbj2h8c...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Hi Ford, Take a look at Hoogle. Indispensable. https://www.haskell.org/hoogle/ Andrew ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 97, Issue 7 ****************************************