Proposal: give a field name to Data.Ord.Down

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal: give a field name to Data.Ord.Down

Fumiaki Kinoshita
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...

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

Re: Proposal: give a field name to Data.Ord.Down

davean
I have needed this many times.

On Thu, May 2, 2019 at 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

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

Re: Proposal: give a field name to Data.Ord.Down

Theodore Lief Gannon
I just added `Down` to the RIO prelude, and the absence of a deconstructor was my #1 concern about doing so. It invites another package to provide an alternative, and we avoid including things with actively competing implementations. I'd much rather see this handled in `base`.

(I'd rather have it named `unDown`, so as not to steal the name `getDown` from the heroes who will pair it with `getFunky`. But that's a lesser concern.)

On Thu, May 2, 2019 at 8:13 PM davean <[hidden email]> wrote:
I have needed this many times.

On Thu, May 2, 2019 at 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

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

Re: Proposal: give a field name to Data.Ord.Down

Edward Kmett-2
In reply to this post by davean
+1 from me, with no preference between getDown and runDown

-Edward

On May 3, 2019, at 1:13 PM, davean <[hidden email]> wrote:

I have needed this many times.

On Thu, May 2, 2019 at 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

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

Re: Proposal: give a field name to Data.Ord.Down

Zemyla
+1 from me, but the field name should be "up".

On Sat, May 4, 2019, 02:29 Edward Kmett <[hidden email]> wrote:
+1 from me, with no preference between getDown and runDown

-Edward

On May 3, 2019, at 1:13 PM, davean <[hidden email]> wrote:

I have needed this many times.

On Thu, May 2, 2019 at 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

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

Re: Proposal: give a field name to Data.Ord.Down

Elliot Cameron-2
I can getDown with this. +1

On Sat, May 4, 2019, 4:17 AM Zemyla <[hidden email]> wrote:
+1 from me, but the field name should be "up".

On Sat, May 4, 2019, 02:29 Edward Kmett <[hidden email]> wrote:
+1 from me, with no preference between getDown and runDown

-Edward

On May 3, 2019, at 1:13 PM, davean <[hidden email]> wrote:

I have needed this many times.

On Thu, May 2, 2019 at 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

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

Re: Proposal: give a field name to Data.Ord.Down

Carter Schonwald
+1

On Sat, May 4, 2019 at 10:08 AM Elliot Cameron <[hidden email]> wrote:
I can getDown with this. +1

On Sat, May 4, 2019, 4:17 AM Zemyla <[hidden email]> wrote:
+1 from me, but the field name should be "up".

On Sat, May 4, 2019, 02:29 Edward Kmett <[hidden email]> wrote:
+1 from me, with no preference between getDown and runDown

-Edward

On May 3, 2019, at 1:13 PM, davean <[hidden email]> wrote:

I have needed this many times.

On Thu, May 2, 2019 at 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

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

Re: Proposal: give a field name to Data.Ord.Down

chessai .
In reply to this post by Fumiaki Kinoshita
+1

On Thu, May 2, 2019, 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

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

Re: Proposal: give a field name to Data.Ord.Down

George Wilson
+1

On Sun., 5 May 2019, 06:21 chessai ., <[hidden email]> wrote:
+1

On Thu, May 2, 2019, 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

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

Re: Proposal: give a field name to Data.Ord.Down

Andrew Martin
+1. I do prefer getDown as the field name, but anything is better than nothing.

Sent from my iPhone

On May 4, 2019, at 9:49 PM, George Wilson <[hidden email]> wrote:

+1

On Sun., 5 May 2019, 06:21 chessai ., <[hidden email]> wrote:
+1

On Thu, May 2, 2019, 10:56 PM Fumiaki Kinoshita <[hidden email]> wrote:
It's awkward to write a lambda to unwrap this kind of wrappers. I propose

newtype Down a = Down { getDown :: a }

with the Show/Read instances as if they didn't have named fields.

The same goes for Control.Arrow.ArrowMonad, although I'm not sure about its usefulness...
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries