Skip to content

non-interactive run of a function in a project? #4253

@ceedubs

Description

@ceedubs

Is there currently a way to do a ucm run (not inside an interactive ucm shell) of a function that lives in a project?

httpserver/main> view example.main
 
  example.main : '{IO, Exception} ()
  example.main = do
    use Nat *
    config = Config.Config None (Port "8081") 10 None
    routes = Routes.default <<< alohaHandler <<< helloHandler
    stopServer = Config.serve routes config
    printLine "started server on port 8081"
    sleep (24 * 60 * 60 * 1000000)
    !stopServer

InputPattern: 5.08 s (cpu), 4.85 s (system)
httpserver/main> 
InputPattern: 8.24 µs (cpu), 14.5 µs (system)

cody@harlan ~/code/unison trunk* 14s
ghc-shell-for-packages ❯ unison run httpserver/main/example.main
 
  ⚠️
  
  Not found: httpserver/main/example.main

Also why did it take 14 seconds to tell me that it couldn't find the term? That seems a little suspect. I guess it has to load a global name index or pretty printer or something?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions