Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,273
    • Issues 4,273
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 413
    • Merge Requests 413
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #1380

Closed
Open
Opened May 26, 2007 by Ian Lynagh <igloo@earth.li>@trac-igloo

Safe Haskell

We should make it easy to do safe (~= no IO) Haskell.

Things to think about include:

  • Expressions with type IO a
  • unsafePerformIO etc
  • unsafe array indexing functions etc
  • FFI declarations
  • Template Haskell
  • bugs like custom Ix instances allowing incorrect array indexing
  • importing other modules which can do unsafe things (this generalises some of the above)
  • Allowing restricted IO functions, e.g. reading/writing functions within a certain directory only

We may want to add support for this to GHC and/or Cabal, e.g. only allow a module to be compiled with -fsafe if (a) all of its imports are marked safe (a new ghc-pkg field) and (b) it only does safe things itself (no TH etc). It would also be possible to tell ghc-pkg that you consider a module safe.

There's a proposal at http://www.pphsg.org/safeghc/ for a similar thing, but at the value level rather than the module/package level. However, we don't think the increased implementation cost is worth the small extra benefit it provides.

One might also worry about resource exhaustion.

There have also been a number of discussions about his on the mailing lists and on IRC, e.g. the thread beginning http://www.haskell.org/pipermail/haskell-cafe/2007-May/025941.html

Working out exactly what it should do is half of the challenge here!

Trac metadata
Trac field Value
Version 6.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component None
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
Assignee
Assign to
⊥
Milestone
⊥
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#1380