Data.List.singleton

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Data.List.singleton

Ben Franksen
...is a function that seems to be missing from base. It is trivial, of
course, but still would be nice to have for symmetry with the modules in
container.

(apologies if this has been discussed before)

Cheers
Ben

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Data.List.singleton

Andreas Abel-2
+1.  "singleton" is clearly more readable in code than the orangutan
face (:[]).

On 26.07.2017 23:51, Ben Franksen wrote:
> ...is a function that seems to be missing from base. It is trivial, of
> course, but still would be nice to have for symmetry with the modules in
> container.
>
> (apologies if this has been discussed before)
>
> Cheers
> Ben

--
Andreas Abel  <><      Du bist der geliebte Mensch.

Department of Computer Science and Engineering
Chalmers and Gothenburg University, Sweden

[hidden email]
http://www.cse.chalmers.se/~abela/
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Data.List.singleton

Henning Thielemann

On Thu, 27 Jul 2017, Andreas Abel wrote:

> +1.  "singleton" is clearly more readable in code than the orangutan
> face (:[]).

An alternative would be Applicative.pure or Monad.return. But yes,
List.singleton is still more readable.
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Loading...