<div dir="ltr">You can get very close -- specifically, to within two extra characters -- to the brevity you're imagining without introducing any new extensions:<br><br>    data Foo = Foo Int Int<br>      deriving (Show)<br><br>    f :: (Int, Int) -> Foo<br>    f = uncurry Foo<br><br>    g :: Int -> Int -> Foo<br>    g = Foo<br><br>`f` is almost what you wanted. `g` will in many situations be terser.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 13, 2022 at 5:12 PM Daneel Yaitskov <<a href="mailto:dyaitskov@gmail.com">dyaitskov@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Cafe,</div><div><br></div><div>There is a group of GHC extensions and complementary classes</div><div>to make writing Haskell code a bit sweeter such as:</div><div> - {} - Num (fromIntegral)<br></div><div> - OverloadedStrings - IsString</div><div> - OverloadedLists - IsList</div><div><br></div><div>So I have an inductive question - why there is no OverloadedTuples?</div><div>I haven't found a discussion thread about this topic.</div><div><br></div><div>I could imagine following tuple syntax interpretation:</div><div><br></div><div>{-# LANGUAGE OverloadedTuples #-}</div><div><br></div><div>data Foo = FooA Int String | FooB String Foo deriving (Show, Eq, IsTuple)</div><div><br></div><div>mkFoo :: Foo</div><div>mkFoo = (1, "hello")</div><div><br></div><div>mkFoo2 :: Foo</div><div>mkFoo = ("abc", (1, "hello"))</div><div><br></div><div>Sometimes expected type name is known without data constructor.</div><div>So such expression is more concise.<br></div><div></div><div><br></div><div><br></div><div><br>-- <br><div dir="ltr"><br>Best regards,<br>Daniil Iaitskov<br> <br><br><br></div></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Jeff Brown | Jeffrey Benjamin Brown</div><div dir="ltr"><a href="https://www.linkedin.com/in/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">LinkedIn</a><span style="font-size:12.8px">   </span><span style="font-size:12.8px">|</span><span style="font-size:12.8px">   </span><a href="https://github.com/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">Github</a>   |   <a href="https://twitter.com/carelogic" target="_blank">Twitter</a>  |  <a href="https://www.facebook.com/mejeff.younotjeff" style="font-size:12.8px" target="_blank">Facebook</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>