stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

Unknown extension: "NoStarIsType"

Open Mikolaj opened this issue 2 years ago • 2 comments

stylish-haskell --version
stylish-haskell 0.14.1.0

It accepts StarIsType fine, but doesn't accept NoStarIsType either in config file nor in file header, saying

Warning (stylish-haskell): stylish-haskell failed: Unknown extension:
    "NoStarIsType"

and due to that, not accepting

import           GHC.TypeLits (type (*))

Mikolaj avatar Apr 22 '22 21:04 Mikolaj

I have the same problem with NoImplicitPrelude. Here is my .stylish-haskell.yaml:

steps:
  - simple_align:
      cases: true
      top_level_patterns: true
      records: true

  # Import cleanup
  - imports:
      align: none
      list_align: after_alias
      pad_module_names: false
      long_list_align: inline
      empty_list_align: inherit
      list_padding: 4
      separate_lists: true
      space_surround: false

  - language_pragmas:
      style: vertical
      remove_redundant: true

  # Remove trailing whitespace
  - trailing_whitespace: {}

columns: 100

newline: native

language_extensions:
  - BangPatterns
  - ConstraintKinds
  - DataKinds
  - DefaultSignatures
  - DeriveAnyClass
  - DeriveDataTypeable
  - DeriveGeneric
  - DerivingStrategies
  - DerivingVia
  - ExplicitNamespaces
  - FlexibleContexts
  - FlexibleInstances
  - FunctionalDependencies
  - GADTs
  - GeneralizedNewtypeDeriving
  - InstanceSigs
  - KindSignatures
  - LambdaCase
  - MultiParamTypeClasses
  - MultiWayIf
  - NamedFieldPuns
  - NoImplicitPrelude
  - OverloadedStrings
  - QuasiQuotes
  - RecordWildCards
  - ScopedTypeVariables
  - StandaloneDeriving
  - TemplateHaskell
  - TupleSections
  - TypeApplications
  - TypeFamilies
  - ViewPatterns

Removing NoImplicitPrelude from the config allows stylish-haskell to work again.

chshersh avatar May 02 '22 12:05 chshersh

+1 for NoImplicitPrelude.

nitinprakash96 avatar May 25 '22 12:05 nitinprakash96

Same Unknown Extension issue for me as well. Appears for NoImplicitPrelude as well as NoMonomorphismRestriction. Any particular reason why this is happening ?

RitickMadaan avatar Sep 20 '22 10:09 RitickMadaan

@jaspervdj: thank you very much. When could we expect a release (if not soon, I'd set up a local checkout).

Mikolaj avatar Sep 28 '22 09:09 Mikolaj

Released in v0.14.3.0

jaspervdj avatar Sep 28 '22 10:09 jaspervdj

Thank you again. I tested and this problem is fixed. Stylish-haskell works great with type-level (*) taken from

import GHC.TypeLits

though it chokes at

import GHC.TypeLits (type (*))

with

Warning (stylish-haskell): stylish-haskell failed: <string>:16:48: error:
    parse error on input `*'

This is with GHC 9.0.2. Should I report that separately? Is that an error in a stylish-haskell dependency perhaps?

Mikolaj avatar Sep 28 '22 10:09 Mikolaj

@Mikolaj That seems like a separate issue, please create a new one -- FYI stylish-haskell is currently using GHC 9.2 as a parser (regardless of which GHC it is compiled with).

jaspervdj avatar Sep 28 '22 11:09 jaspervdj

Done: https://github.com/haskell/stylish-haskell/issues/414

Mikolaj avatar Sep 28 '22 17:09 Mikolaj