moduleLogic(dimensions)where{- Dependency to a Hackage pkg: https://hackage.haskell.org/package/terminfo -}importqualifiedSystem.Console.Terminfo.BaseasTermimportSystem.Console.Terminfo.Cursordimensions::IO(Int,Int)dimensions=doterm<-Term.setupTermFromEnvlet(Justheight)=Term.getCapabilitytermtermLineslet(Justwidth)=Term.getCapabilitytermtermColumnsreturn(height,width)
#!/usr/bin/envstack{- stack
--resolver lts-8.21
--install-ghc
script
--package terminfo
--
-Wall -Werror
-}moduleMain(main)where{- Import local file which has a dependency to a Hackage pkg:
https://hackage.haskell.org/package/terminfo
-}importqualifiedLogicasTerminalmain::IO()main=do(height,width)<-Terminal.dimensionsputStrLn("Term height: "++(showheight)++" & width: "++(showwidth))