CaseInsensitive type

22 views
Skip to first unread message

Richard Wallace

unread,
Mar 4, 2012, 10:33:34 PM3/4/12
to sca...@googlegroups.com
Any objections to me adding a CaseInsensitive[1] type to scalaz-core?
It's a direct port of the Haskell version[2]. It's really useful for
when you want to use strings as map keys and sets without
case-sensitivity.

Rich

[1] http://paste.pocoo.org/show/555790/
[2] http://hackage.haskell.org/package/case-insensitive-0.4.0.1

Runar Bjarnason

unread,
Mar 4, 2012, 10:35:02 PM3/4/12
to sca...@googlegroups.com
That would be awesome.

> --
> You received this message because you are subscribed to the Google Groups "scalaz" group.
> To post to this group, send email to sca...@googlegroups.com.
> To unsubscribe from this group, send email to scalaz+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/scalaz?hl=en.
>

Tony Morris

unread,
Mar 4, 2012, 10:37:40 PM3/4/12
to sca...@googlegroups.com
Looks good. I notice you don't have the map function. Maybe you could
instance Functor for a general case and write a mapf method that uses
the FoldCase restriction in the type? Dunno, leave that up to you -- but
no objections here -- do it.

--
Tony Morris
http://tmorris.net/


Richard Wallace

unread,
Mar 4, 2012, 11:50:27 PM3/4/12
to sca...@googlegroups.com
Done [1]. I cleaned it up a bit, added map - although I couldn't
figure out a way to implement a Functor instance without completely
violating the invariants.

Rich

[1] https://github.com/scalaz/scalaz/commit/b74821aa912ec3ac7871a6e1f106176038b402b4

Tony Morris

unread,
Mar 4, 2012, 11:59:11 PM3/4/12
to sca...@googlegroups.com

Yeah maybe it's not a functor after all. Cheers mate.

Reply all
Reply to author
Forward
0 new messages