| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
PlutusTx.Data.List.TH
Documentation
Arguments
| ∷ String | Prefix of the generated bindings | 
| → Set Int | Element ids you need, starting from 0 | 
| → Name | The builtin list to destruct | 
| → ExpQ | The computation that consumes the elements | 
| → ExpQ | 
Generate variables bound to the given indices of a BuiltinList.
Sample Usage:
  f :: List Integer -> Integer
  f list =
  $( destructList
       "s"
       (Set.fromList [1, 4, 5])
       'list
       [|s1 + s4 + s5|]
   )
This computes the sum of list elements at indices 1, 4 and 5.