-- 생성자는 항상 새 인스턴스를 준다. private 생성자 + static create 면 셋이 된다
create :: String -> Maybe User -- 1 실패를 값으로 (null / Result)
create name | length name < 3 = Nothing
| otherwise = Just (User name)
shape :: Kind -> Size -> Shape -- 2 하위 클래스를 고른다 (팩토리)
shape Circle = circle
shape Rect = rectangle
config :: IO Config -- 3 같은 인스턴스 (싱글톤): instance ??= new Config()
config = readIORef instanceRef >>= maybe (newConfig >>= cache) pure
-- 단순 초기화만이면 생성자가 더 직관적