In a medium bowl, mix together the flour, baking soda, salt, and spices: cinnamon, nutmeg, ginger, and dried carrot shreds. Set this mixture aside.
In a mixing bowl with the paddle attachment, cream together the butter and brown sugar on medium speed for about 3 minutes, until the mixture is light and fluffy. Incorporate the maple syrup and mix until well combined. Next, add the egg and vanilla extract, scraping down the sides and bottom of the bowl as necessary.
Gradually add the flour mixture, beating on low speed just until combined. Then, gently fold in the pecans and raisins by hand to prevent over-mixing.
Wrap the cookie dough in plastic wrap and refrigerate for at least an hour. If the dough becomes too firm to handle, let it sit at room temperature for a few minutes to soften.
Preheat your oven to 350°F/180°C and line two baking sheets with parchment paper. Using a cookie scoop or spoon, drop rounded balls of dough (about 30g or 1.5 tablespoons each) onto the prepared sheets, leaving a 2-inch/5cm space between each cookie. If desired, roll the cookie dough balls in coconut before baking.
Bake for 10 minutes, or until the edges begin to brown. The cookies may look slightly underbaked but will continue to cook on the warm baking sheet. Allow the cookies to cool on the pan for 5 minutes before transferring them to a wire rack to cool completely before frosting.