Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C curry-frontend
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 71
    • Issues 71
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • curry
  • curry-frontend
  • Merge requests
  • !55

Add NoDataDeriving language extension

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Fredrik Wieczerkowski requested to merge no-data-deriving into master Jun 17, 2022
  • Overview 0
  • Commits 3
  • Pipelines 0
  • Changes 4

This branch adds the new language extension NoDataDeriving for disabling the implicit deriving of Prelude.Data instances. For example, the following program will no longer compile:

{-# LANGUAGE NoDataDeriving #-}

data X = A | B

data Y

requireData :: Data a => a
requireData = failed

main :: IO ()
main = do
  return (requireData :: X)
  return (requireData :: Y)
  return ()
Error:
    Missing instance for Prelude.Data X
    in explicitly typed expression
    requireData

Error:
    Missing instance for Prelude.Data Y
    in explicitly typed expression
    requireData

The idea behind making this a language extension (instead of e.g. a simple flag) is that is similar in spirit to NoImplicitPrelude and that it changes core language semantics. Additionally this opens up the possibility of having NoImplicitPrelude imply NoDataDeriving in the future.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: no-data-deriving