Equation has different number of arguments

后端 未结 1 1781
终归单人心
终归单人心 2021-01-15 02:19

I made these data types to represent guitar tabs and I\'m trying to write the show function to print them as real guitar tabs. datas are not my spe

相关标签:
1条回答
  • 2021-01-15 02:58

    The second instance needs more parentheses:

    instance Show Chord where
      show (EmptyChord a) = init $ take (a * 2) ['-', '\n' ..]
      show (Chord (x : xs)) = x : '\n' : show xs
    
    0 讨论(0)
提交回复
热议问题