Skip to content

Commit

Permalink
Declare fixity of exponentiation (Clash.Class.Exp)
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrains1 committed Oct 3, 2024
1 parent 3b755b9 commit 78279a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/2024-10-03T17_02_19+02_00_exp_fixity
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FIXED: Exponentiation (`Clash.Class.Exp`) now binds as `infixr 8` instead of the implicit `infixl 9` which resulted from forgetting to specify the fixity.
5 changes: 4 additions & 1 deletion clash-prelude/src/Clash/Class/Exp.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{-|
Copyright : (C) 2019, Myrtle Software Ltd
2024, QBayLogic B.V.
License : BSD2 (see the file LICENSE)
Maintainer : Christiaan Baaij <christiaan.baaij@gmail.com>
Maintainer : QBayLogic B.V. <devops@qaylogic.com>
-}

{-# LANGUAGE CPP #-}
Expand Down Expand Up @@ -38,6 +39,8 @@ class Exp a where
-> ExpResult a n
-- ^ Resized result, guaranteed to not have overflown

infixr 8 ^

instance KnownNat m => Exp (Index m) where
type ExpResult (Index m) n = Index (Max 2 (m ^ n))

Expand Down

0 comments on commit 78279a1

Please sign in to comment.