haskell-jp / beginners #24

@高橋紀美 has joined the channel
@working neco has joined the channel
はじめまして Haskell初心者の 五十嵐雅哉です。
質問失礼します。
チュートリアルとして、.txtファイルの簡単な読み込みをしながら機械的な応答をするチャットサーバーを作りました。
立てたあといつでも応答則の変更ができるように、メッセージが来たらFileIOで読みこんで、それに基づいて何かメッセージを返すようなことをしています。すると、定期的に以下のエラーが出て落ちます。

data: end of file
Main: file descriptor 45546384 out of range for select (0--1024).
Recompile with -threaded to work around this.

コンパイル方法で解決する問題でしょうか?ご教示いただければ幸いです。

{package.yaml}
ghc-options:
- -Wall
- -Wcompat
- -Widentities
- -Wincomplete-record-updates
- -Wincomplete-uni-patterns
- -Wmissing-export-lists
- -Wmissing-home-modules
- -Wpartial-fields
- -Wredundant-constraints
- -threaded

ファイル読み込み部のコードは以下で、調べつつ手探りで行ったものなのでかなり怪しい気もします。
readWordGroup :: FilePath -> IO [Text]
readWordGroup filePath = bracket
  (openFile filePath ReadMode)  
  hClose  
  (\h -> T.words <$> TIO.hGetContents h) 

よろしくお願いします。
... Replies ...
@R has joined the channel
@ has joined the channel
@kei.ad has joined the channel
@sat0ma has joined the channel
@bizyutyu has joined the channel
@mitsuru793 has joined the channel
@ has joined the channel
@haru It has joined the channel
1000 k_k_y_a_n
@1000 k_k_y_a_n has joined the channel
@ has joined the channel
初歩的ですが質問をさせてください

「Haskell入門」を参考にパッケージsplit-0.2.4のモジュールData.List.SplitのSplitOnメソッドを使ってパーサーを作っています。
コードは以下の通りです。
import Data.List.Split

data YMD =YMD Int Int Int deriving Show

parseYMD :: String -> Maybe YMD
parseYMD = listToymd . splitOn "/"
    where
        listToymd :: [String] -> Maybe YMD
        listToymd (y:m:d:_) = Just $ YMD (read y) (read m) (read d)
        listToymd _ = Nothing

これをpar.hsとして保存しています。

runghc par.hs --package split-0.2.4

と打って実行を試みると次のようなエラーが出てしまいます。原因を教えてください。
(なおパッケージのインストールはstack install より行っています)

par.hs:1:1: error:
    Could not find module 'Data.List.Split'
    Use -v to see a list of the files searched for.
  |
1 | import Data.List.Split
  | ^^^^^^^^^^^^^^^^^^^^^^
... Replies ...
@ymorita has joined the channel
@Birudo Un has joined the channel
@lesguillemets has joined the channel
@Sato Naoto has joined the channel
Reminder: beginnersチャンネルは、新しい人がスムーズにHaskellに慣れるための質問を歓迎するチャンネルです。 Haskell-Beginners ML や IRCの#haskell-beginners  や RedditのMonthly Hask Anythingのような位置づけを意図しています。 beginnersチャンネルでの回答側は、以下の左側のような応答を厳禁とする運用です。 • それはくだらない質問だ → くだらない質問など無い • その質問は以前にもあった → 質問者はそんなこと知らない • Google検索せよ → 検索できないから質問している beginnersチャンネルでは、例えば以下のレベルの質問から歓迎します。 • : とは何のことですか。 • タプルとは何ですか。
@Carlos Fontes has joined the channel
@kb2 kkb2 has joined the channel
@hk_slack2 has joined the channel
@ふぃえ has joined the channel
@qwfe43h has joined the channel
@峰岸零 has joined the channel
Rinat Stryungis
@Rinat Stryungis has joined the channel
@Cqug has joined the channel
@Katsy has joined the channel
absinthe drunker (atカフェ)
@absinthe drunker (atカフェ) has joined the channel
@jqoh has joined the channel
@CLERK has joined the channel
Hiroyuki Hirano
@Hiroyuki Hirano has joined the channel
Reminder: beginnersチャンネルは、新しい人がスムーズにHaskellに慣れるための質問を歓迎するチャンネルです。 Haskell-Beginners ML や IRCの#haskell-beginners  や RedditのMonthly Hask Anythingのような位置づけを意図しています。 beginnersチャンネルでの回答側は、以下の左側のような応答を厳禁とする運用です。 • それはくだらない質問だ → くだらない質問など無い • その質問は以前にもあった → 質問者はそんなこと知らない • Google検索せよ → 検索できないから質問している beginnersチャンネルでは、例えば以下のレベルの質問から歓迎します。 • : とは何のことですか。 • タプルとは何ですか。
@中村悠人 has joined the channel
@ymshita has joined the channel
@U5K has joined the channel
Kohei Kajikawa
@Kohei Kajikawa has joined the channel
パズルマン
@パズルマン has joined the channel
パズルマン
Haskellの環境構築について質問させていただきたく思います。
https://zenn.dev/mod_poppo/articles/haskell-setup-2023
主にこちらの記事を参考に、MacBook(CPUはIntel)にHaskellの環境構築をしています。GHCのダウンロード中にCコンパイラが見つからないという趣旨のエラーが出ました。記事ではCコンパイラをインストールせよとのことでしたが、Cコンパイラのインストールはできているはずなので原因がよくわかりません。再インストールなど色々試してみましたが現状インストールができていないといった状況です。
コンピュータについて詳しくないので基本的なことをできていないかもしれません。Haskellと直接関係ない質問かもしれませんが、アドバイスをいただきたく思います。
... Replies ...
Masaharu Inomata
@Masaharu Inomata has joined the channel
@ has joined the channel
@ has joined the channel
@ZeAng Cui has joined the channel
@森本涼介 has joined the channel
@cdepillabout has joined the channel
@Y O has joined the channel