From 2a257b5317b34bfa940e8daa8e7afd4f0643fd86 Mon Sep 17 00:00:00 2001 From: Edsko de Vries Date: Tue, 15 Oct 2024 13:54:37 +0200 Subject: [PATCH] Document required dependencies and extensions --- large-records/CHANGELOG.md | 3 ++- large-records/src/Data/Record/Plugin.hs | 28 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/large-records/CHANGELOG.md b/large-records/CHANGELOG.md index 55e2568..fdb617d 100644 --- a/large-records/CHANGELOG.md +++ b/large-records/CHANGELOG.md @@ -2,8 +2,9 @@ ## 0.4.2 -- 2024-10-15 -* Support `primitive-0.7.3` (#159, Isaac Elliott) +* Support `primitive-0.7.3` (#159, Isaac Elliott). * Plugin idempotence (#159, Isaac Elliott). +* Document required additional dependencies and language extensions (#161). Note: if your code imports `Data.Plugin.Record` only for the `largeRecord` identifier used in the `ANN` annotations, this import is no longer required diff --git a/large-records/src/Data/Record/Plugin.hs b/large-records/src/Data/Record/Plugin.hs index f06d351..e731be1 100644 --- a/large-records/src/Data/Record/Plugin.hs +++ b/large-records/src/Data/Record/Plugin.hs @@ -14,6 +14,34 @@ -- -- See 'LargeRecordOptions' for the list of all possible annotations. -- +-- = Dependencies +-- +-- In addition to the dependency on @large-records@, you will also need to add +-- dependencies +-- on [large-generics](http://hackage.haskell.org/package/large-generics) +-- and [record-hasfield](http://hackage.haskell.org/package/record-hasfield). +-- +-- = Language extensions +-- +-- The plugin depends on a number of language extensions. If you are using +-- GHC2021, you will need enable: +-- +-- > {-# LANGUAGE DataKinds #-} +-- > {-# LANGUAGE TypeFamilies #-} +-- > {-# LANGUAGE UndecidableInstances #-} +-- +-- If you are using Haskell2010, you need to enable: +-- +-- > {-# LANGUAGE ConstraintKinds #-} +-- > {-# LANGUAGE DataKinds #-} +-- > {-# LANGUAGE FlexibleInstances #-} +-- > {-# LANGUAGE GADTs #-} +-- > {-# LANGUAGE MultiParamTypeClasses #-} +-- > {-# LANGUAGE ScopedTypeVariables #-} +-- > {-# LANGUAGE TypeFamilies #-} +-- > {-# LANGUAGE TypeOperators #-} +-- > {-# LANGUAGE UndecidableInstances #-} +-- -- = Usage with @record-dot-preprocessor@ -- -- The easiest way to use both plugins together is to do