# Pastebin MCWdxUyf memo' :: forall t a. Grouping t => (t -> a) -> IO (t -> IO a) memo' t2a = do output <- newIORef (error "you done goofed") f <- getGroup (grouping @t) \(t2a -> a) -> do writeIORef output a return \_ -> writeIORef output a return \t -> f t t *> readIORef output