Haskellに入門する
作った(ている)もの
読みもの
とても良いそう
このサイトの邦訳「すごいHaskell たのしく学ぼう!」を読んだ。Functor辺りからもう一度読む
ArticlesにあるHaskellの記事の以下読んだ、良かった
「Haskell入門 関数型プログラミング言語の基礎と実践」
「せつラボ ~圏論の基本~」
「矢澤にこ先輩といっしょに代数!」
登壇されていたそう。半群の手前のマグマという代数についてもある
面白かった。現実世界の具体的な話で圏を説明されてる
ログ
code:sh
~/github.com/ddddddO/work
Welcome to Haskell!
This script can download and install the following binaries:
* ghcup - The Haskell toolchain installer
* ghc - The Glasgow Haskell Compiler
* cabal - The Cabal build tool for managing Haskell software
* stack - A cross-platform program for developing Haskell projects (similar to cabal)
* hls - (optional) A language server for developers to integrate with their editor/IDE
ghcup installs only into the following directory,
which can be removed anytime:
/home/ochi/.ghcup
Press ENTER to proceed or ctrl-c to abort.
Note that this script can be re-run at any given time.
-------------------------------------------------------------------------------
Detected bash shell on your system...
Do you want ghcup to automatically add the required PATH variable to "/home/ochi/.bashrc"?
P Yes, prepend A Yes, append N No ? Help (default is "P"). P
-------------------------------------------------------------------------------
Do you want to install haskell-language-server (HLS)?
HLS is a language-server that provides IDE-like functionality
and can integrate with different editors, such as Vim, Emacs, VS Code, Atom, ...
Y Yes N No ? Help (default is "N"). Y
-------------------------------------------------------------------------------
Do you want to enable better integration of stack with GHCup?
This means that stack won't install its own GHC versions, but uses GHCup's.
For more information see:
If you want to keep stacks vanilla behavior, answer 'No'.
Y Yes N No ? Help (default is "Y"). Y
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15.2M 100 15.2M 0 0 7567k 0 0:00:02 0:00:02 --:--:-- 7567k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 243k 100 243k 0 0 1150k 0 --:--:-- --:--:-- --:--:-- 1144k
Warn No GHCup update available System requirements
Please ensure the following distro packages are installed before continuing (you can exit ghcup and return at any time): build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
Press ENTER to proceed or ctrl-c to abort.
Installation may take a while.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 232M 100 232M 0 0 24.5M 0 0:00:09 0:00:09 --:--:-- 23.7M
Info verifying digest of: ghc-9.2.7-x86_64-deb10-linux.tar.xz Info Unpacking: ghc-9.2.7-x86_64-deb10-linux.tar.xz to /home/ochi/.ghcup/tmp/ghcup-76338424cb07b0b8 Info Installing GHC (this may take a while) Info Merging file tree from "/home/ochi/.ghcup/tmp/ghcup-b491a4133923fa7a/home/ochi/.ghcup/ghc/9.2.7" to "/home/ochi/.ghcup/ghc/9.2.7" Info GHC installation successful % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Info GHC 9.2.7 successfully set as default version % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4523k 100 4523k 0 0 2041k 0 0:00:02 0:00:02 --:--:-- 2042k
Info verifying digest of: cabal-install-3.6.2.0-x86_64-linux-alpine-static.tar.xz Info Unpacking: cabal-install-3.6.2.0-x86_64-linux-alpine-static.tar.xz to /home/ochi/.ghcup/tmp/ghcup-a762a9697ed25331 Info Cabal installation successful Config file path source is default config file.
Config file /home/ochi/.cabal/config not found.
Writing default configuration to /home/ochi/.cabal/config
Downloading the latest package list from hackage.haskell.org
Updated package list of hackage.haskell.org to the index-state 2023-04-20T12:43:21Z
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 167M 100 167M 0 0 23.3M 0 0:00:07 0:00:07 --:--:-- 27.5M
Info verifying digest of: haskell-language-server-1.10.0.0-x86_64-linux-deb11.tar.xz Info Unpacking: haskell-language-server-1.10.0.0-x86_64-linux-deb11.tar.xz to /home/ochi/.ghcup/tmp/ghcup-5b3d3ef73663e95a Info Merging file tree from "/home/ochi/.ghcup/tmp/ghcup-076688fe7f56b10a/home/ochi/.ghcup/hls/1.10.0.0" to "/home/ochi/.ghcup/hls/1.10.0.0" Info HLS installation successful Info This is just the server part of your LSP configuration. Consult the README on how to ... configure HLS, your project and your LSP client in your editor: % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 13.2M 100 13.2M 0 0 2244k 0 0:00:06 0:00:06 --:--:-- 3697k
Info verifying digest of: stack-2.9.3-linux-x86_64-static.tar.gz Info Unpacking: stack-2.9.3-linux-x86_64-static.tar.gz to /home/ochi/.ghcup/tmp/ghcup-2c9fc72c7b3c58d2 Info Stack installation successful Info Stack manages GHC versions internally by default. To improve integration, please visit: % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 664 100 664 0 0 707 0 --:--:-- --:--:-- --:--:-- 710
===============================================================================
OK! /home/ochi/.bashrc has been modified. Restart your terminal for the changes to take effect,
or type "source /home/ochi/.ghcup/env" to apply them in your current terminal session.
===============================================================================
All done!
To start a simple repl, run:
ghci
To start a new haskell project in the current directory, run:
cabal init --interactive
To install other GHC versions and tools, run:
ghcup tui
~/github.com/ddddddO/work
22:31:23 >
Haskellは、型システムの学習にも良いそう
ghc Hoge.hs 実行でエラー出ても、以下で解決