tilia-0.1.1.0: corpora/vendored/declaration/value/function/let-chain.hs
module Kiln.Glaze where
-- A let ending its line with in, and followed by another let, keeps that
-- line, and the next let goes under it; the last one is laid out as usual.
glaze :: Int -> (Int, Int)
glaze x =
-- Count the first one:
let a = x + 1 in
let b = a * 2; c = b + 1 in
-- Then the second:
let d = c - 1 in
(a, d)
-- Written all on one line, the chain stays on it.
fire :: Int -> Int
fire x = let a = x + 1 in let b = a * 2 in a + b
-- A let whose bindings take several lines chains the same way where its in
-- ends the last of them.
cool :: Int -> Int
cool x =
let a = x + 1
b = a * 2 in
let c = a + b in
c