Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
pakcs
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 16
    • Issues 16
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • curry
  • pakcs
  • Issues
  • #8

Closed
Open
Opened Feb 22, 2017 by Jan Rasmus Tikovsky @jrt

Problem when using Global and where-clause

Consider the following program:

module Main where

import Global (Global, global, GlobalSpec(Temporary))
import Unsafe(unsafePerformIO)
import IO(Handle)
import Socket

debugSocketHandleGlobal :: Global Handle
debugSocketHandleGlobal = global (unsafePerformIO openport) Temporary
  where
    openport = catch (connectToSocket "localhost" 33) errorhandler
    errorhandler _ = error "could not connect to debugging server (i.e. to eclipse)" 

main = do
  print 42

Compiling this program with PAKCS results in the following error:

Prelude> :l Main.curry 
[1 of 8] Skipping  Prelude          ( /net/medoc/home/pakcs/amd64/pakcs/lib/Prelude.curry, /net/medoc/home/pakcs/amd64/pakcs/lib/.curry/Prelude.fcy )
[2 of 8] Skipping  Char             ( /net/medoc/home/pakcs/amd64/pakcs/lib/Char.curry, /net/medoc/home/pakcs/amd64/pakcs/lib/.curry/Char.fcy )
[3 of 8] Skipping  Global           ( /net/medoc/home/pakcs/amd64/pakcs/lib/Global.curry, /net/medoc/home/pakcs/amd64/pakcs/lib/.curry/Global.fcy )
[4 of 8] Skipping  IO               ( /net/medoc/home/pakcs/amd64/pakcs/lib/IO.curry, /net/medoc/home/pakcs/amd64/pakcs/lib/.curry/IO.fcy )
[5 of 8] Skipping  System           ( /net/medoc/home/pakcs/amd64/pakcs/lib/System.curry, /net/medoc/home/pakcs/amd64/pakcs/lib/.curry/System.fcy )
[6 of 8] Skipping  Socket           ( /net/medoc/home/pakcs/amd64/pakcs/lib/Socket.curry, /net/medoc/home/pakcs/amd64/pakcs/lib/.curry/Socket.fcy )
[7 of 8] Skipping  Unsafe           ( /net/medoc/home/pakcs/amd64/pakcs/lib/Unsafe.curry, /net/medoc/home/pakcs/amd64/pakcs/lib/.curry/Unsafe.fcy )
[8 of 8] Compiling Main             ( Main.curry, .curry/Main.fcy )

Main.curry, line 14.1: Warning:
    Top-level binding with no type signature: main :: Prelude.IO ()
ERROR in "Main.debugSocketHandleGlobal": Function "Global.global" is not allowed in this context!
ERROR during compilation of program "Main"!
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: curry/pakcs#8