Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これに解析エラーがあるのはなぜですか? リストを挿入してタプルを取り出したい。(一番上の行は正しいです)。
freq :: Eq a => [a] -> [(Int,a)] freq x:xs = [(x,y)| (x,y) x <- count , y <- rmdups]
ここには 2 つの構文エラーがあります。パターンに括弧がなく(x,y)、内包表記内に間違って配置されています。そのはず:
(x,y)
freq (x : xs) = [(x, y) | x <- count, y <- rmdups]
パターンマッチに括弧を入れる必要があります
freq (x:xs) = {- ... -}