Open in app

Sign In

Write

Sign In

Wisut Hantanong
Wisut Hantanong

7 Followers

Home

About

Dec 24, 2017

การเรียกใช้ function ใน Haskell 3 วิธี

การเรียกใช้ function (function application) ใน Haskell ที่พบได้ใน code ทั่วไป มีอย่างน้อย 3 แบบ 1. f x (space) เป็น function application operator ของ Haskell, f1 a เทียบเท่ากับ f1(a) ในภาษาอื่นเนื่องจาก function เป็นหน่วยพื้นฐานใน Hasell ไวยากรณ์การใช้งาน function ที่กระชับช่วยให้ code มีสิ่งรบกวนน้อย 2. f $ x ($) :: (a -> b) -> a -> b เป็น binary operator (function ที่มี 2 argument) ที่นิยมใช้เพื่อลดจำนวนวงเล็บ

Haskell

1 min read

Haskell

1 min read


Aug 2, 2017

clone git อย่างเร็วด้วย shallow clone

หากต้องการแค่ใช้ code ล่าสุดโดยไม่สนใจประวัติการแก้ไขก่อนหน้านั้น หรือต้องการใช้กับ Continuous Integration (CI) เราสามาถเลือกความลึกของประวัิตได้ ด้วย --depth n ตัวอย่าง: ความลึกเท่ากับ 1 จะได้ commit ล่าสุดเพียง commit เดียว ด้วยขนาด 14MiB $ git clone --depth 1 https://github.com/NixOS/nixpkgs Cloning into 'nixpkgs'... remote: Counting objects: 20622, done. remote: Compressing objects: 100% (14606/14606), done. remote: Total 20622 (delta 592), reused 14395 (delta 339), pack-reused 0 Receiving objects: 100% (20622/20622), 14.38 MiB | 152.00 KiB/s, done. Resolving deltas: 100% (592/592), done.

Git

1 min read

Git

1 min read


Jul 29, 2017

Various ways to use GHC in nix-shell

Posted on July 29, 2017 There are many ways to use GHC in nix-shell System’s default GHC $ nix-shell -p ghc System’s default GHC with additional libraries $ nix-shell -p 'haskellPackages.ghcWithPackages (self: with self; [ random ])' Specific version with libraries $ nix-shell -p 'haskell.packages.ghc7103.ghcWithPackages (self: with self; [ random ])' with shell.nix Originally published with more details at wizzup.github.io.

Nixos

1 min read

Nixos

1 min read


Jul 20, 2017

วิธีแก้ข้อความ commit ของ git

เมื่อต้องการแก้ไข commit message ระดับ 1: แก้ข้อความล่าสุด git commit --amend -m "ข้อความใหม่" ระดับ 2: แก้ข้อความจำนวนน้อยทีละข้อความ git rebase -i <rev_before> จะมี rebase todo-list ขึ้นมา เลือก reword กับ commit ที่ต้องการแก้ไขแล้วบันทึก จากนั้น git จะเรียก editor ขึ้นมาให้แก้ข้อความเมื่อถึงคิวของ commit นั้น (แก้ใน rebase-todo ไม่ได้ จะถูกโยนทิ้งไป) pick db96dee move newpost.sh out from posts reword 4cd9e33 2017-06-02 pick f19d2af add socials…

Git

1 min read

Git

1 min read

Wisut Hantanong

Wisut Hantanong

7 Followers

wizzup.github.io

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams