I’m looking into how I’ve invoked stack to turn a Haskell source file into an executable shell script before and comparing it to the official documentation.

In my VOD repository, I have this migration script which contains the following at the top:

#!/usr/bin/env stack
{- stack runghc
    --resolver lts-21.1
    --package aeson
    --package aeson-pretty
    --package bytestring
    --package containers
    --package non-empty-text
    --package relude
    --package req
    --package safe
    --package text
    --package timespan
    --package turtle
    --package tz
-}

The documentation now appears to recommend using stack script instead of stack runghc:

#!/usr/bin/env stack
-- stack script --snapshot lts-22.28 --package turtle
{-# LANGUAGE OverloadedStrings #-}
import Turtle (echo)
main = echo "Hello World!"

Though, it still supports runghc for backwards compatibility reasons.