Talk:Sum data type: Difference between revisions

From Rosetta Code
Content added Content deleted
 
Line 4: Line 4:


Perhaps something which requires simple option types of the Maybe or Either variety ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 10:20, 25 June 2019 (UTC)
Perhaps something which requires simple option types of the Maybe or Either variety ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 10:20, 25 June 2019 (UTC)

e.g. the definition and use of something like the Haskell '''either''' function, which performs case analysis on a sum type value, applying one function if the value is a 'Left', and another if the value is a 'Right'. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:17, 25 June 2019 (UTC)


Or requires and uses the construction of trees with sum type nodes ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 10:23, 25 June 2019 (UTC)
Or requires and uses the construction of trees with sum type nodes ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 10:23, 25 June 2019 (UTC)

Latest revision as of 11:17, 25 June 2019

Perhaps needs more specification – a concrete and focused task ?

Always helpful (for any useful contrast / comparability of submissions) to have a problem to solve, and a suggested input, with expected output.

Perhaps something which requires simple option types of the Maybe or Either variety ? Hout (talk) 10:20, 25 June 2019 (UTC)

e.g. the definition and use of something like the Haskell either function, which performs case analysis on a sum type value, applying one function if the value is a 'Left', and another if the value is a 'Right'. Hout (talk) 11:17, 25 June 2019 (UTC)

Or requires and uses the construction of trees with sum type nodes ? Hout (talk) 10:23, 25 June 2019 (UTC)