
13 Jan
2022
13 Jan
'22
5:12 p.m.
Cafe, There is a group of GHC extensions and complementary classes to make writing Haskell code a bit sweeter such as: - {} - Num (fromIntegral) - OverloadedStrings - IsString - OverloadedLists - IsList So I have an inductive question - why there is no OverloadedTuples? I haven't found a discussion thread about this topic. I could imagine following tuple syntax interpretation: {-# LANGUAGE OverloadedTuples #-} data Foo = FooA Int String | FooB String Foo deriving (Show, Eq, IsTuple) mkFoo :: Foo mkFoo = (1, "hello") mkFoo2 :: Foo mkFoo = ("abc", (1, "hello")) Sometimes expected type name is known without data constructor. So such expression is more concise. -- Best regards, Daniil Iaitskov