1
data A = B | C Int
implementation Semigroup A where
B <+> x = x
x <+> B = x
C m <+> C n = C (m + n)
дает мне ошибку синтаксисаWeird ошибка синтаксиса
./Nodes/Test.idr:3:1: error: expected: ";",
"|", declaration, end of input
implementation Semigroup A where
^
Type checking ./Nodes/Test.idr
в Идриса 0.11.2. вместо Удаление implementation
дает это сообщение:
./Nodes/Test.idr:3:13: error: expected: "@",
"with", argument expression,
constraint argument,
function right hand side,
implicit function argument,
with pattern
Semigroup A where
^
Type checking ./Nodes/Test.idr
Если я получаю сообщение об ошибке? Я не вижу ничего плохого в синтаксисе.
Спасибо.
Блестящий! Благодарю. – RhubarbAndC