Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Mohamed Tarek mohamed82008

👋
View GitHub Profile
@mohamed82008
mohamed82008 / params.jl
Last active Sep 26, 2020
Macro to add type parameters
View params.jl
"""
@params struct_def
A macro that changes all fields' types to type parameters while respecting the type bounds specificied by the user. For example:
```
@params struct MyType{T}
f1::T
f2::AbstractVector{T}
f3::AbstractVector{<:Real}
f4