Equation has different number of arguments

后端 未结 1 1791
终归单人心
终归单人心 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)
提交回复
热议问题