[Haskell-cafe] Instance deps (was: [announcement] filtrable: class of filtrable containers)

Oleg Grenrus oleg.grenrus at iki.fi
Wed Feb 17 19:47:25 UTC 2016


There are discussions once in a while:

https://www.reddit.com/r/haskell/comments/2rajq1/is_there_anything_planned_to_solve_the_orphan/ <https://www.reddit.com/r/haskell/comments/2rajq1/is_there_anything_planned_to_solve_the_orphan/>
https://www.reddit.com/r/haskell/comments/1id0p7/backpack_retrofitting_haskell_with_interfaces/cb3eb2n <https://www.reddit.com/r/haskell/comments/1id0p7/backpack_retrofitting_haskell_with_interfaces/cb3eb2n>

I’m not sure what’s the story with backpack, way or another it would need to solve instance problem.

- Oleg

> On 17 Feb 2016, at 20:34, amindfv at gmail.com wrote:
> 
> 
> 
>> El 17 feb 2016, a las 12:16, M Farkas-Dyck <m.farkasdyck at gmail.com> escribió:
>> 
>>> On 17/02/2016, Joachim Breitner <mail at joachim-breitner.de> wrote:
>>> You might want to add laws in the style of
>>> 
>>>   If this is also a Foldable, then
>>>      toList . mapMaybe f = mapMapybe f . toList
>>>      toList . catMaybes = catMaybes . toList
>>>      toList . filter f = filter f . toList
>> 
>> Shall do.
>> 
>>> Do you plan to add instances for all the other data structures in base
>>> that are filtrable?
>> 
>> Yes, if i missed any, please let me know which ☺
>> 
>>> On 17/02/2016, Oleg Grenrus <oleg.grenrus at iki.fi> wrote:
>>> - I’d also like to see instances for types in containers,
>>> unordered-containers, vector and semigroup.
>> 
>> I was hoping to have no deps but base... alas, Cabal and Hackage seem
>> to have no good way to have instance deps, so the instances must be in
>> either the package defining the class or the one defining the types
>> which are instances of it.
> 
> Are there any existing proposals for a solution to this?
> 
> Tom
> 
> 
>> 
>>> If you don’t mind I can make a PR for the instances.
>> 
>> Feel free to do so for containers and vector at least. I may want this
>> to not transitively depend on unordered-containers → hashable → text,
>> but if enough potential users want these instances i'll include them
>> (containers and vector come with GHC so it's not so bad). What types
>> in semigroups would you add instances of?
>> 
>>> - The OtherLicense seems a bit scary (even the contents aren’t),
>>> is there a good reason why you don’t use more familiar MIT or BSD3?
>> 
>> Too verbose. I might use ISC if it weren't also an OtherLicense...
>> 
>>> The law:
>>> 
>>>   filter f = mapMaybe (liftA2 (<$) id (guard ∘ f))
>>> 
>>> is very hard to understand.
>> 
>> Rewritten.
>> 
>>> On 17/02/2016, Simon Jakobi <simon.jakobi at googlemail.com> wrote:
>>> your package looks very similar to
>>> http://hackage.haskell.org/package/witherable!
>> 
>> Witherable has Traversable superclass, but some Filtrable types may
>> not be Traversable.
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160217/abca16d6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160217/abca16d6/attachment.sig>


More information about the Haskell-Cafe mailing list